Example #1
0
 public static float[] toFloatArray(Vec3 vec) {
   float[] f = new float[3];
   f[0] = vec.getX();
   f[1] = vec.getY();
   f[2] = vec.getZ();
   return f;
 }
Example #2
0
 public Vec3 multiply3x3(final Vec3 vec) {
   final float x = vec.getX();
   final float y = vec.getY();
   final float z = vec.getZ();
   return new Vec3(
       x * this.data[M00] + y * this.data[M01] + z * this.data[M02],
       x * this.data[M10] + y * this.data[M11] + z * this.data[M12],
       x * this.data[M20] + y * this.data[M21] + z * this.data[M22]);
 }
Example #3
0
 public Vec3 multiply(final Vec3 vec) {
   final float x = vec.getX();
   final float y = vec.getY();
   final float z = vec.getZ();
   final float rcpw =
       1.0f / (x * this.data[M30] + y * this.data[M31] + z * this.data[M32] + this.data[M33]);
   return new Vec3(
       (x * this.data[M00] + y * this.data[M01] + z * this.data[M02] + this.data[M03]) * rcpw,
       (x * this.data[M10] + y * this.data[M11] + z * this.data[M12] + this.data[M13]) * rcpw,
       (x * this.data[M20] + y * this.data[M21] + z * this.data[M22] + this.data[M23]) * rcpw);
 }