Exemplo n.º 1
0
        public void ConstrainedAlignAxis(int nAxis, Vector3F vTo, Vector3F vAround)
        {
            Debug.Assert(rotation.w != 0);
            Vector3F    axis   = GetAxis(nAxis);
            float       fAngle = MathUtil.PlaneAngleSignedD(axis, vTo, vAround);
            Quaternionf rot    = Quaternionf.AxisAngleD(vAround, fAngle);

            Rotate(rot);
        }
Exemplo n.º 2
0
        public static Quaternionf FromToConstrained(Vector3F vFrom, Vector3F vTo, Vector3F vAround)
        {
            float fAngle = MathUtil.PlaneAngleSignedD(vFrom, vTo, vAround);

            return(Quaternionf.AxisAngleD(vAround, fAngle));
        }