public MovableModel(Model model, Matrix4 transform) : base(transform) { m_model = model; m_transforms = new Matrix[m_model.Bones.Count]; m_model.CopyAbsoluteBoneTransformsTo (m_transforms); }
public CastableModel(Model model, Matrix4 transform) : base(model, transform) { }
// this' = this * M; right-multiply matrix semantics // Ignore translation when transforming a normal public void transformNormal(Matrix4 m) { float tx = X * m.Right.X + Y * m.Up.X + Z * m.Backward.X; float ty = X * m.Right.Y + Y * m.Up.Y + Z * m.Backward.Y; float tz = X * m.Right.Z + Y * m.Up.Z + Z * m.Backward.Z; X = tx; Y = ty; Z = tz; }
// this' = this * M^(-1); right-multiply matrix semantics public void transformByInverse(Matrix4 m) { m.invert (); transform (m); }
//public Matrix3 (OpenTK.Matrix4 m) // : this (m.Right, m.Up, m.Forward) //{ //} // Normalize the height of "m" regardless of "ensureOrthonormal" public Matrix3(Matrix4 m, bool ensureOrthonormal) : this(m.Right, m.Up, m.Forward, true) { }
public MovableQuat(Matrix4 transform) { m_rotation = transform.Rotation.getQuaternion (); m_position = transform.Translation; m_scale = new Vector3 (1.0f); }
public static void invert(ref Matrix4 m, out Matrix4 inverse) { Matrix4 copy = m; copy.invert (); inverse = copy; }
static Matrix4() { ms_identity = new Matrix4 (true); }