public Transformation () { translation = new Vector3f(0,0,0); scale = new Vector3f(1,1,1); rotation = Matrix3f.Identity(); transformation = Matrix4f.Identity(); }
public bool Equals (Matrix3f b) { // If parameter is null return false: if ((object)b == null) { return false; } // Return true if the fields match: return m00 == b.m00 && m11 == b.m11 && m22 == b.m22 && m01 == b.m01 && m02 == b.m02 && m10 == b.m10 && m12 == b.m12 && m20 == b.m20 && m21 == b.m21; }
public Matrix4f @set (Matrix3f matrix) { // TODO: Check the dimensions of data JWM m00 = matrix.@get(0,0); m01 = matrix.@get(0,1); m02 = matrix.@get(0,2); m03 = 0; m10 = matrix.@get(1,0); m11 = matrix.@get(1,1); m12 = matrix.@get(1,2); m13 = 0; m20 = matrix.@get(2,0); m21 = matrix.@get(2,1); m22 = matrix.@get(2,2); m23 = 0; m30 = 0; m31 = 0; m32 = 0; m33 = 0; return this; }
public Matrix3f CopyFrom (ref Matrix3f matrix) { m00 = matrix.m00; m01 = matrix.m01; m02 = matrix.m02; m10 = matrix.m10; m11 = matrix.m11; m12 = matrix.m12; m20 = matrix.m20; m21 = matrix.m21; m22 = matrix.m22; return matrix; }
public static Matrix3f Identity () { Matrix3f i = new Matrix3f (1, 0, 0, 0, 1, 0, 0, 0, 1); return i; }
public Matrix3f CopyTo (ref Matrix3f matrix) { matrix.m00 = m00; matrix.m01 = m01; matrix.m02 = m02; matrix.m10 = m10; matrix.m11 = m11; matrix.m12 = m12; matrix.m20 = m20; matrix.m21 = m21; matrix.m22 = m22; return matrix; }
public Matrix3f Multiply (ref Matrix3f b, ref Matrix3f c) { c.m00 = m00 * b.m00 + m10 * b.m01 + m20 * b.m02; c.m01 = m01 * b.m00 + m11 * b.m01 + m21 * b.m02; c.m02 = m02 * b.m00 + m12 * b.m01 + m22 * b.m02; c.m10 = m00 * b.m10 + m10 * b.m11 + m20 * b.m12; c.m11 = m01 * b.m10 + m11 * b.m11 + m21 * b.m12; c.m12 = m02 * b.m10 + m12 * b.m11 + m22 * b.m12; c.m20 = m00 * b.m20 + m10 * b.m21 + m20 * b.m22; c.m21 = m01 * b.m20 + m11 * b.m21 + m21 * b.m22; c.m22 = m02 * b.m20 + m12 * b.m21 + m22 * b.m22; return c; }
public Matrix3f Multiply (ref Matrix3f b) { float c00 = m00 * b.m00 + m10 * b.m01 + m20 * b.m02; float c01 = m01 * b.m00 + m11 * b.m01 + m21 * b.m02; float c02 = m02 * b.m00 + m12 * b.m01 + m22 * b.m02; float c10 = m00 * b.m10 + m10 * b.m11 + m20 * b.m12; float c11 = m01 * b.m10 + m11 * b.m11 + m21 * b.m12; float c12 = m02 * b.m10 + m12 * b.m11 + m22 * b.m12; float c20 = m00 * b.m20 + m10 * b.m21 + m20 * b.m22; float c21 = m01 * b.m20 + m11 * b.m21 + m21 * b.m22; float c22 = m02 * b.m20 + m12 * b.m21 + m22 * b.m22; m00 = c00; m01 = c01; m02 = c02; m10 = c10; m11 = c11; m12 = c12; m20 = c20; m21 = c21; m22 = c22; return this; }
public Matrix3f Subtract (ref Matrix3f b) { m00 -= b.m00; m01 -= b.m01; m02 -= b.m02; m10 -= b.m10; m11 -= b.m11; m12 -= b.m12; m20 -= b.m20; m21 -= b.m21; m22 -= b.m22; return this; }
public Matrix3f Add (ref Matrix3f b) { m00 += b.m00; m01 += b.m01; m02 += b.m02; m10 += b.m10; m11 += b.m11; m12 += b.m12; m20 += b.m20; m21 += b.m21; m22 += b.m22; return this; }