BEPUutilities2.Matrix3x3.Multiply C# (CSharp) Method

Multiply() private method

private Multiply ( Matrix3x3 &a, Matrix3x3 &b, Matrix3x3 &result ) : void
a Matrix3x3
b Matrix3x3
result Matrix3x3
return void
        public static void Multiply(ref Matrix3x3 a, ref Matrix3x3 b, out Matrix3x3 result)
        {
            var bX = b.X;
            var bY = b.Y;
            {
                var x = new Vector3(a.X.X);
                var y = new Vector3(a.X.Y);
                var z = new Vector3(a.X.Z);
                result.X = x * bX + y * bY + z * b.Z;
            }

            {
                var x = new Vector3(a.Y.X);
                var y = new Vector3(a.Y.Y);
                var z = new Vector3(a.Y.Z);
                result.Y = x * bX + y * bY + z * b.Z;
            }

            {
                var x = new Vector3(a.Z.X);
                var y = new Vector3(a.Z.Y);
                var z = new Vector3(a.Z.Z);
                result.Z = x * bX + y * bY + z * b.Z;
            }
        }

Usage Example

Exemplo n.º 1
0
        public static void Multiply(ref AffineTransform a, ref AffineTransform b, out AffineTransform transform)
        {
            Vector3 translation;

            Matrix3x3.Transform(ref a.Translation, ref b.LinearTransform, out translation);
            transform.Translation = b.Translation + translation;
            Matrix3x3.Multiply(ref a.LinearTransform, ref b.LinearTransform, out transform.LinearTransform);
        }