public MatrixRenderTexture( int width, int height, Matrix4F matrix ) : base(width, height) { this.matrix = matrix; }
public void MultiplyOn( Matrix4F matrix ) { var x = matrix[0] * this.X + matrix[4] * this.Y + matrix[08] * this.Z + matrix[12] * this.W; var y = matrix[1] * this.X + matrix[5] * this.Y + matrix[09] * this.Z + matrix[13] * this.W; var z = matrix[2] * this.X + matrix[6] * this.Y + matrix[10] * this.Z + matrix[14] * this.W; var w = matrix[3] * this.X + matrix[7] * this.Y + matrix[11] * this.Z + matrix[15] * this.W; this.X = x; this.Y = y; this.Z = z; this.W = w; }
public void SetPosition( Matrix4F position ) { this.Position = position; this.actor.GlobalPose = (Matrix)position; }
public static Matrix4F operator -( Matrix4F a, Matrix4F b ) { var sumMatrix = new Matrix4F { A00 = (a.A00 - b.A00), A01 = (a.A01 - b.A01), A02 = (a.A02 - b.A02), A03 = (a.A03 - b.A03), A10 = (a.A10 - b.A10), A11 = (a.A11 - b.A11), A12 = (a.A12 - b.A12), A13 = (a.A13 - b.A13), A20 = (a.A20 - b.A20), A21 = (a.A21 - b.A21), A22 = (a.A22 - b.A22), A23 = (a.A23 - b.A23), A30 = (a.A30 - b.A30), A31 = (a.A31 - b.A31), A32 = (a.A32 - b.A32), A33 = (a.A33 - b.A33), }; return sumMatrix; }
// ReSharper restore SuggestBaseTypeForParameter public void MultiplyOn( Matrix4F m ) { Multiply( this.data, m.data, this.data ); }
public static Matrix4F operator +( Matrix4F a, Matrix4F b ) { var sumMatrix = new Matrix4F { A00 = (a.A00 + b.A00), A01 = (a.A01 + b.A01), A02 = (a.A02 + b.A02), A03 = (a.A03 + b.A03), A10 = (a.A10 + b.A10), A11 = (a.A11 + b.A11), A12 = (a.A12 + b.A12), A13 = (a.A13 + b.A13), A20 = (a.A20 + b.A20), A21 = (a.A21 + b.A21), A22 = (a.A22 + b.A22), A23 = (a.A23 + b.A23), A30 = (a.A30 + b.A30), A31 = (a.A31 + b.A31), A32 = (a.A32 + b.A32), A33 = (a.A33 + b.A33), }; return sumMatrix; }
public static Matrix4F operator *( Matrix4F a, Matrix4F b ) { var sumMatrix = new Matrix4F(); Multiply( a.data, b.data, sumMatrix.data ); return sumMatrix; }
public static Matrix4F operator *( Matrix4F a, float value ) { var mulMatrix = new Matrix4F(); for (var i = 0; i < mulMatrix.data.Length; i++) mulMatrix.data[i] = a.data[i] * value; return mulMatrix; }
public void SetToMatrix( Matrix4F matrix ) { matrix[0] = +cosPitch; matrix[4] = 0; matrix[08] = sinPitch; matrix[1] = -sinPitch * sinYaw; matrix[5] = +cosYaw; matrix[09] = sinYaw * cosPitch; matrix[2] = -sinPitch * cosYaw; matrix[6] = -sinYaw; matrix[10] = cosYaw * cosPitch; }
public void SetInvertToMatrix( Matrix4F matrix ) { matrix[0] = +cosPitch; matrix[1] = 0; matrix[02] = sinPitch; matrix[4] = -sinPitch * sinYaw; matrix[5] = +cosYaw; matrix[06] = sinYaw * cosPitch; matrix[8] = -sinPitch * cosYaw; matrix[9] = -sinYaw; matrix[10] = cosYaw * cosPitch; }