public void ConstrainedAlignAxis(int nAxis, Vector3d vTo, Vector3d vAround) { Vector3d axis = GetAxis(nAxis); double fAngle = MathUtil.PlaneAngleSignedD(axis, vTo, vAround); Quaterniond rot = Quaterniond.AxisAngleD(vAround, fAngle); Rotate(rot); }
public static Quaterniond FromToConstrained(Vector3d vFrom, Vector3d vTo, Vector3d vAround) { double fAngle = MathUtil.PlaneAngleSignedD(vFrom, vTo, vAround); return(Quaterniond.AxisAngleD(vAround, fAngle)); }