BEPUutilities.Matrix3x3.TransformTranspose C# (CSharp) Метод

TransformTranspose() публичный статический Метод

Transforms the vector by the matrix's transpose.
public static TransformTranspose ( System.Vector3 &v, Matrix &matrix, System.Vector3 &result ) : void
v System.Vector3 Vector3 to transform.
matrix Matrix Matrix to use as the transformation transpose.
result System.Vector3 Product of the transformation.
Результат void
        public static void TransformTranspose(ref Vector3 v, ref Matrix matrix, out Vector3 result)
        {
            float vX = v.X;
            float vY = v.Y;
            float vZ = v.Z;
#if !WINDOWS
            result = new Vector3();
#endif
            result.X = vX * matrix.M11 + vY * matrix.M12 + vZ * matrix.M13;
            result.Y = vX * matrix.M21 + vY * matrix.M22 + vZ * matrix.M23;
            result.Z = vX * matrix.M31 + vY * matrix.M32 + vZ * matrix.M33;
        }

Same methods

Matrix3x3::TransformTranspose ( System.Vector3 v, Matrix3x3 matrix ) : System.Vector3
Matrix3x3::TransformTranspose ( System.Vector3 &v, Matrix3x3 &matrix, System.Vector3 &result ) : void

Usage Example

Пример #1
0
        ///<summary>
        /// Transforms a vector by an affine transform's inverse.
        ///</summary>
        ///<param name="position">Position to transform.</param>
        ///<param name="transform">Transform to invert and apply.</param>
        ///<param name="transformed">Transformed position.</param>
        public static void TransformInverse(ref Vector3 position, ref AffineTransform transform, out Vector3 transformed)
        {
            Vector3.Subtract(ref position, ref transform.Translation, out transformed);
            Matrix3x3 inverse;

            Matrix3x3.Invert(ref transform.LinearTransform, out inverse);
            Matrix3x3.TransformTranspose(ref transformed, ref inverse, out transformed);
        }