BEPUphysics.Constraints.TwoEntity.Motors.RevoluteMotor.SetupJointTransforms C# (CSharp) Метод

SetupJointTransforms() публичный Метод

Sets up the joint transforms by automatically creating perpendicular vectors to complete the bases.
public SetupJointTransforms ( System.Vector3 motorizedAxis ) : void
motorizedAxis System.Vector3 Axis around which the motor acts.
Результат void
        public void SetupJointTransforms(Vector3 motorizedAxis)
        {
            //Compute a vector which is perpendicular to the axis.  It'll be added in local space to both connections.
            Vector3 xAxis;
            Vector3.Cross(ref motorizedAxis, ref Toolbox.UpVector, out xAxis);
            float length = xAxis.LengthSquared();
            if (length < Toolbox.Epsilon)
            {
                Vector3.Cross(ref motorizedAxis, ref Toolbox.RightVector, out xAxis);
            }

            //Put the axes into the joint transform of A.
            basis.rotationMatrix = connectionA.orientationMatrix;
            basis.SetWorldAxes(motorizedAxis, xAxis);


            //Put the axes into the 'joint transform' of B too.
            TestAxis = basis.xAxis;
        }