Example #1
0
 /// <summary>
 /// Return a Vector rotated around the Quaternion
 /// </summary>
 /// <param name="q1">
 /// Quaternion
 /// </param>
 /// <param name="v2">
 /// Vector
 /// </param>
 /// <returns>
 /// </returns>
 public static Vector3 RotateVector3(Quaternion q1, Vector3 v2)
 {
     Quaternion QuatVect = new Quaternion(v2.x, v2.y, v2.z, 0);
     Quaternion QuatNorm = q1.Normalize();
     Quaternion Result = Hamilton(Hamilton(QuatNorm, QuatVect), QuatNorm.Conjugate());
     return new Vector3(Result.x, Result.y, Result.z);
 }