public static Matrix CreateShear(Shear3D shear) { Matrix result = Identity; result.M11 = 1; result.M12 = shear.XY; result.M13 = shear.XZ; result.M14 = 0; result.M21 = shear.YX; result.M22 = 1; result.M23 = shear.YZ; result.M24 = 0; result.M31 = shear.ZX; result.M32 = shear.ZY; result.M33 = 1; result.M34 = 0; result.M41 = 0; result.M42 = 0; result.M43 = 0; result.M44 = 1; return(result); }
public static Matrix CreateTransform(Vector3 origin, Vector3 position, Quaternion rotation, Vector3 scale, Shear3D shear) { Matrix transformMatrix = Identity; if (origin != Vector3.Zero) { transformMatrix *= CreateTranslation(-origin); } if (shear != Shear3D.Identity) { transformMatrix *= CreateShear(shear); } if (scale != Vector3.One) { transformMatrix *= CreateScale(scale); } if (rotation != Quaternion.Identity) { transformMatrix *= rotation.Matrix; } if (position != Vector3.Zero) { if (origin != Vector3.Zero) { transformMatrix *= CreateTranslation(position - origin); } else { transformMatrix *= CreateTranslation(position); } } if (origin != Vector3.Zero) { transformMatrix *= CreateTranslation(origin); } return(transformMatrix); }
public bool Equals(Shear3D shear3D) { return(this == shear3D); }