Here you can find the source of multiplyVector(float[] mat, float[] vec, float[] dest)
public static float[] multiplyVector(float[] mat, float[] vec, float[] dest)
//package com.java2s; //License from project: Open Source License public class Main { public static float[] multiplyVector(float[] mat, float[] vec, float[] dest) { if (dest == null) { dest = vec;//from w ww .j a v a 2s . com } float vec0 = vec[0]; float vec1 = vec[1]; float vec2 = vec[2]; float vec3 = vec[3]; dest[0] = mat[0] * vec0 + mat[4] * vec1 + mat[8] * vec2 + mat[12] * vec3; dest[1] = mat[1] * vec0 + mat[5] * vec1 + mat[9] * vec2 + mat[13] * vec3; dest[2] = mat[2] * vec0 + mat[6] * vec1 + mat[10] * vec2 + mat[14] * vec3; dest[3] = mat[3] * vec0 + mat[7] * vec1 + mat[11] * vec2 + mat[15] * vec3; return dest; } }