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; }
public Transform(Vector Offset, Vector VelocityOffset, Quaternion Rotation) { this.Offset = Offset; this.VelocityOffset = VelocityOffset; this.Rotation = Rotation; }
public Transform(Vector Offset) { this.Offset = Offset; this.VelocityOffset = new Vector(0.0, 0.0, 0.0); this.Rotation = Quaternion.Identity; }
/// <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); }
/// <summary> /// Applies the rotation represented by this quaternion to another. /// </summary> public Quaternion ApplyTo(Quaternion Other) { return Quaternion.Normalize(this * Other); }
/// <summary> /// Applies a rotation to this quaternion. /// </summary> public Quaternion Apply(Quaternion Other) { return Quaternion.Normalize(Other * this); }
/// <summary> /// Normalizes the specified quaternion. /// </summary> public static Quaternion Normalize(Quaternion A) { A.Normalize(); return A; }
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; }