public static FromQuaternion ( |
||
quaternion | ||
Résultat |
public static void Multiply(ref RigidTransform3 rigidTransform, ref AffineTransform3 affineTransform, out AffineTransform3 result) { Matrix3.FromQuaternion(ref rigidTransform.Orientation, out result.Transform); Matrix3.Multiply(ref result.Transform, ref affineTransform.Transform, out result.Transform); Vector3.Transform(ref rigidTransform.Position, ref affineTransform.Transform, out result.Translation); result.Translation += affineTransform.Translation; }
public AffineTransform3 Multiply(ref RigidTransform3 transform) { AffineTransform3 result; Matrix3.FromQuaternion(ref transform.Orientation, out result.Transform); Matrix3.Multiply(ref result.Transform, ref Transform, out result.Transform); Vector3.Transform(ref transform.Position, ref Transform, out result.Translation); result.Translation += Translation; return(result); }
public static void RotateAround(ref Matrix3 matrix, ref Vector3 axis, float angle, out Matrix3 result) { // rotate into world space var quaternion = Reign.Core.Quaternion.FromRotationAxis(axis, 0); Reign.Core.Quaternion.Conjugate(ref quaternion, out quaternion); Matrix3.FromQuaternion(ref quaternion, out result); Matrix3.Multiply(ref matrix, ref result, out result); // rotate back to matrix space Reign.Core.Quaternion.FromRotationAxis(ref axis, angle, out quaternion); var qMat = Matrix3.FromQuaternion(quaternion); Matrix3.Multiply(ref result, ref qMat, out result); }
public Matrix3 RotateAround(ref Vector3 axis, float angle) { // rotate into world space var quaternion = Reign.Core.Quaternion.FromRotationAxis(axis, 0); Reign.Core.Quaternion.Conjugate(ref quaternion, out quaternion); var worldSpaceMatrix = Matrix3.FromQuaternion(quaternion); Matrix3.Multiply(ref this, ref worldSpaceMatrix, out worldSpaceMatrix); // rotate back to matrix space Reign.Core.Quaternion.FromRotationAxis(ref axis, angle, out quaternion); var qMat = Matrix3.FromQuaternion(quaternion); Matrix3.Multiply(ref worldSpaceMatrix, ref qMat, out worldSpaceMatrix); return(worldSpaceMatrix); }
public static void FromRigidTransform(ref RigidTransform3 transform, out AffineTransform3 result) { result.Translation = transform.Position; Matrix3.FromQuaternion(ref transform.Orientation, out result.Transform); }
public AffineTransform3(Quaternion orientation, Vector3 scale, Vector3 translation) { Transform = Matrix3.FromQuaternion(orientation) * scale; Translation = translation; }
public static void FromRotationAxis(ref Vector3 axis, float angle, out Matrix3 result) { Core.Quaternion quaternion; Core.Quaternion.FromRotationAxis(ref axis, angle, out quaternion); Matrix3.FromQuaternion(ref quaternion, out result); }
public Matrix3 FromRotationAxis(Vector3 axis, float angle) { Core.Quaternion quaternion; Core.Quaternion.FromRotationAxis(ref axis, angle, out quaternion); return(Matrix3.FromQuaternion(quaternion)); }
public static void FromRigidTransform(ref RigidTransform3 transform, out Matrix4 result) { var qMat = Matrix3.FromQuaternion(transform.Orientation); Core.Matrix4.FromAffineTransform(ref qMat, ref transform.Position, out result); }
public static Matrix4 FromRigidTransform(RigidTransform3 transform) { return(Matrix4.FromAffineTransform(Matrix3.FromQuaternion(transform.Orientation), transform.Position)); }