BEPUphysics.Constraints.JointBasis3D.SetWorldAxes C# (CSharp) Method

SetWorldAxes() public method

Sets up the axes of the transform and ensures that it is an orthonormal basis.
public SetWorldAxes ( Matrix3x3 matrix ) : void
matrix Matrix3x3 Rotation matrix representing the three axes. /// The matrix's backward vector is used as the primary axis. /// The matrix's right vector is used as the x axis. /// The matrix's up vector is used as the y axis.
return void
        public void SetWorldAxes(Matrix3x3 matrix)
        {
            if (Math.Abs(Vector3.Dot(matrix.Backward, matrix.Right)) > Toolbox.BigEpsilon ||
                Math.Abs(Vector3.Dot(matrix.Backward, matrix.Up)) > Toolbox.BigEpsilon ||
                Math.Abs(Vector3.Dot(matrix.Right, matrix.Up)) > Toolbox.BigEpsilon)
                throw new ArgumentException("The axes provided to the joint transform do not form an orthonormal basis.  Ensure that each axis is perpendicular to the other two.");

            primaryAxis = Vector3.Normalize(matrix.Backward);
            xAxis = Vector3.Normalize(matrix.Right);
            yAxis = Vector3.Normalize(matrix.Up);
            Matrix3x3.TransformTranspose(ref this.primaryAxis, ref rotationMatrix, out localPrimaryAxis);
            Matrix3x3.TransformTranspose(ref this.xAxis, ref rotationMatrix, out localXAxis);
            Matrix3x3.TransformTranspose(ref this.yAxis, ref rotationMatrix, out localYAxis);
        }

Same methods

JointBasis3D::SetWorldAxes ( Vector3 primaryAxis, Vector3 xAxis, Vector3 yAxis ) : void
JointBasis3D::SetWorldAxes ( Vector3 primaryAxis, Vector3 xAxis, Vector3 yAxis, Matrix3x3 rotationMatrix ) : void