Beispiel #1
0
 public Transform(Quaternion Rotation)
 {
     this.Offset = new Vector(0.0, 0.0, 0.0);
     this.VelocityOffset = new Vector(0.0, 0.0, 0.0);
     this.Rotation = Rotation;
 }
Beispiel #2
0
 public Transform(Vector Offset, Vector VelocityOffset, Quaternion Rotation)
 {
     this.Offset = Offset;
     this.VelocityOffset = VelocityOffset;
     this.Rotation = Rotation;
 }
Beispiel #3
0
 public Transform(Vector Offset)
 {
     this.Offset = Offset;
     this.VelocityOffset = new Vector(0.0, 0.0, 0.0);
     this.Rotation = Quaternion.Identity;
 }
Beispiel #4
0
 /// <summary>
 /// Applies a rotation created by a quaternion to this axis-angle rotation.
 /// </summary>
 public AxisAngle Apply(Quaternion Rotation)
 {
     return new AxisAngle(Rotation.Rotate(this.Axis), Angle);
 }
Beispiel #5
0
 /// <summary>
 /// Applies the rotation represented by this quaternion to another.
 /// </summary>
 public Quaternion ApplyTo(Quaternion Other)
 {
     return Quaternion.Normalize(this * Other);
 }
Beispiel #6
0
 /// <summary>
 /// Applies a rotation to this quaternion.
 /// </summary>
 public Quaternion Apply(Quaternion Other)
 {
     return Quaternion.Normalize(Other * this);
 }
Beispiel #7
0
 /// <summary>
 /// Normalizes the specified quaternion.
 /// </summary>
 public static Quaternion Normalize(Quaternion A)
 {
     A.Normalize();
     return A;
 }
Beispiel #8
0
 public static Quaternion operator *(Quaternion A, Quaternion B)
 {
     Quaternion q = new Quaternion(
         A.A * B.A - A.B * B.B - A.C * B.C - A.D * B.D,
         A.A * B.B + A.B * B.A + A.C * B.D - A.D * B.C,
         A.A * B.C - A.B * B.D + A.C * B.A + A.D * B.B,
         A.A * B.D + A.B * B.C - A.C * B.B + A.D * B.A);
     return q;
 }