/// <summary>
 /// Applies the given rotation to this object.
 /// </summary>
 /// <param name="rotation"></param>
 public void Rotate(Quaterniond rotation)
 {
     SetXY(rotation.Apply(_x), rotation.Apply(_y));
 }
Beispiel #2
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="quaternion"></param>
 public void Set(Quaterniond quaternion)
 {
     throw new NotImplementedException();
 }
 /// <summary>
 ///
 /// </summary>
 public OrthoBasis3d(Quaterniond quaternion)
     : this()
 {
     Set(quaternion);
 }
Beispiel #4
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="r0"></param>
 /// <param name="r1"></param>
 /// <param name="factor"></param>
 /// <returns></returns>
 public static Quaterniond Nlerp(Quaterniond r0, Quaterniond r1, double factor)
 {
     return(r0.NlerpTo(r1, factor));
 }
Beispiel #5
0
 /// <summary>
 ///
 /// </summary>
 public Rotation3d(Quaterniond quaternion)
     : this()
 {
     Set(quaternion);
 }
Beispiel #6
0
 /// <summary>
 /// Returns the unit quaternion dot product.
 /// This is the cosine of the angle between the 2 rotations.
 /// </summary>
 /// <param name="r0"></param>
 /// <param name="r1"></param>
 /// <returns></returns>
 public static double Dot(Quaterniond r0, Quaterniond r1)
 {
     return(r0.X * r1.X + r0.Y * r1.Y + r0.Z * r1.Z + r0.W * r1.W);
 }
Beispiel #7
0
 /// <summary>
 /// Normalized linear interpolation between this quaternion and another.
 /// </summary>
 /// <param name="other"></param>
 /// <param name="factor"></param>
 /// <returns></returns>
 public Quaterniond NlerpTo(Quaterniond other, double factor)
 {
     return(LerpTo(other, factor).Versor);
 }
Beispiel #8
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="r0"></param>
 /// <param name="r1"></param>
 /// <returns></returns>
 public static Quaterniond CreateFromTo(Quaterniond r0, Quaterniond r1)
 {
     return(r1.Apply(r0.Inverse));
 }
Beispiel #9
0
 /// <summary>
 /// Applies the given rotation to the axis of this rotation.
 /// </summary>
 /// <param name="rotation"></param>
 public void RotateAxis(Quaterniond rotation)
 {
     _axis = rotation.Apply(_axis);
 }
Beispiel #10
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="rotation"></param>
 public AxisAngle3d(Quaterniond rotation)
     : this()
 {
     Set(rotation);
 }