1 //------------------------------------------------------------------------------
4 // This file was automatically generated by SWIG (http://www.swig.org).
7 // Do not make changes to this file unless you know what you are doing--modify
8 // the SWIG interface file instead.
9 //------------------------------------------------------------------------------
17 public class Rotation : global::System.IDisposable
19 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
20 protected bool swigCMemOwn;
22 internal Rotation(global::System.IntPtr cPtr, bool cMemoryOwn)
24 swigCMemOwn = cMemoryOwn;
25 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
28 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Rotation obj)
30 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
35 DisposeQueue.Instance.Add(this);
39 /// To make Rotation instance be disposed.
41 public virtual void Dispose()
43 if (!Window.IsInstalled())
45 DisposeQueue.Instance.Add(this);
51 if (swigCPtr.Handle != global::System.IntPtr.Zero)
56 NDalicPINVOKE.delete_Rotation(swigCPtr);
58 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
60 global::System.GC.SuppressFinalize(this);
65 /// Addition operator.
67 /// <param name="arg1">First Rotation</param>
68 /// <param name="arg2">Second Rotation</param>
69 /// <returns>A Rotation containing the result of the Addition</returns>
70 public static Rotation operator +(Rotation arg1, Rotation arg2)
72 return arg1.Add(arg2);
76 /// Subtraction operator.
78 /// <param name="arg1">First Rotation</param>
79 /// <param name="arg2">Second Rotation</param>
80 /// <returns>A Rotation containing the result of the subtract</returns>
81 public static Rotation operator -(Rotation arg1, Rotation arg2)
83 return arg1.Subtract(arg2);
87 /// Unary Negation operator.
89 /// <param name="arg1">First Rotation</param>
90 /// <returns>A Rotation containing the negated result</returns>
91 public static Rotation operator -(Rotation arg1)
93 return arg1.Subtract();
97 /// Multiplication operator.
99 /// <param name="arg1">First Rotation</param>
100 /// <param name="arg2">Second Rotation</param>
101 /// <returns>A Rotation containing the result of the Multiplication</returns>
102 public static Rotation operator *(Rotation arg1, Rotation arg2)
104 return arg1.Multiply(arg2);
108 /// Multiplication operator.
110 /// <param name="arg1">Rotation</param>
111 /// <param name="arg2">The vector to multiply</param>
112 /// <returns>A Rotation containing the result of the multiplication</returns>
113 public static Vector3 operator *(Rotation arg1, Vector3 arg2)
115 return arg1.Multiply(arg2);
121 /// <param name="arg1">Rotation</param>
122 /// <param name="arg2">A value to scale by</param>
123 /// <returns>A Rotation containing the result of the scaling</returns>
124 public static Rotation operator *(Rotation arg1, float arg2)
126 return arg1.Multiply(arg2);
130 /// Division operator.
132 /// <param name="arg1">First Rotation</param>
133 /// <param name="arg2">Second Rotation</param>
134 /// <returns>A Rotation containing the result of the scaling</returns>
135 public static Rotation operator /(Rotation arg1, Rotation arg2)
137 return arg1.Divide(arg2);
143 /// <param name="arg1">Rotation</param>
144 /// <param name="arg2">A value to scale by</param>
145 /// <returns>A Rotation containing the result of the scaling</returns>
146 public static Rotation operator /(Rotation arg1, float arg2)
148 return arg1.Divide(arg2);
152 /// Default Constructor.
154 public Rotation() : this(NDalicPINVOKE.new_Rotation__SWIG_0(), true)
156 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
160 /// Constructor from an axis and angle.
162 /// <param name="angle">The angle around the axis</param>
163 /// <param name="axis">The vector of the axis</param>
164 public Rotation(Radian angle, Vector3 axis) : this(NDalicPINVOKE.new_Rotation__SWIG_1(Radian.getCPtr(angle), Vector3.getCPtr(axis)), true)
166 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
170 /// (0.0f,0.0f,0.0f,1.0f)
172 public static Rotation IDENTITY
176 global::System.IntPtr cPtr = NDalicPINVOKE.Rotation_IDENTITY_get();
177 Rotation ret = (cPtr == global::System.IntPtr.Zero) ? null : new Rotation(cPtr, false);
178 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
184 /// Helper to check if this is an identity quaternion.
186 /// <returns>True if this is identity quaternion</returns>
187 public bool IsIdentity()
189 bool ret = NDalicPINVOKE.Rotation_IsIdentity(swigCPtr);
190 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
195 /// Converts the quaternion to an axis/angle pair.
197 /// <param name="axis">the result of axis</param>
198 /// <param name="angle">the result of angle Angle in radians</param>
199 /// <returns>True if converted correctly</returns>
200 public bool GetAxisAngle(Vector3 axis, Radian angle)
202 bool ret = NDalicPINVOKE.Rotation_GetAxisAngle(swigCPtr, Vector3.getCPtr(axis), Radian.getCPtr(angle));
203 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
207 private Rotation Add(Rotation other)
209 Rotation ret = new Rotation(NDalicPINVOKE.Rotation_Add(swigCPtr, Rotation.getCPtr(other)), true);
210 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
214 private Rotation Subtract(Rotation other)
216 Rotation ret = new Rotation(NDalicPINVOKE.Rotation_Subtract__SWIG_0(swigCPtr, Rotation.getCPtr(other)), true);
217 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
221 private Rotation Multiply(Rotation other)
223 Rotation ret = new Rotation(NDalicPINVOKE.Rotation_Multiply__SWIG_0(swigCPtr, Rotation.getCPtr(other)), true);
224 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
228 private Vector3 Multiply(Vector3 other)
230 Vector3 ret = new Vector3(NDalicPINVOKE.Rotation_Multiply__SWIG_1(swigCPtr, Vector3.getCPtr(other)), true);
231 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
235 private Rotation Divide(Rotation other)
237 Rotation ret = new Rotation(NDalicPINVOKE.Rotation_Divide__SWIG_0(swigCPtr, Rotation.getCPtr(other)), true);
238 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
242 private Rotation Multiply(float scale)
244 Rotation ret = new Rotation(NDalicPINVOKE.Rotation_Multiply__SWIG_2(swigCPtr, scale), true);
245 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
249 private Rotation Divide(float scale)
251 Rotation ret = new Rotation(NDalicPINVOKE.Rotation_Divide__SWIG_1(swigCPtr, scale), true);
252 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
256 private Rotation Subtract()
258 Rotation ret = new Rotation(NDalicPINVOKE.Rotation_Subtract__SWIG_1(swigCPtr), true);
259 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
263 private Rotation AddAssign(Rotation other)
265 Rotation ret = new Rotation(NDalicPINVOKE.Rotation_AddAssign(swigCPtr, Rotation.getCPtr(other)), false);
266 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
270 private Rotation SubtractAssign(Rotation other)
272 Rotation ret = new Rotation(NDalicPINVOKE.Rotation_SubtractAssign(swigCPtr, Rotation.getCPtr(other)), false);
273 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
277 private Rotation MultiplyAssign(Rotation other)
279 Rotation ret = new Rotation(NDalicPINVOKE.Rotation_MultiplyAssign__SWIG_0(swigCPtr, Rotation.getCPtr(other)), false);
280 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
284 private Rotation MultiplyAssign(float scale)
286 Rotation ret = new Rotation(NDalicPINVOKE.Rotation_MultiplyAssign__SWIG_1(swigCPtr, scale), false);
287 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
291 private Rotation DivideAssign(float scale)
293 Rotation ret = new Rotation(NDalicPINVOKE.Rotation_DivideAssign(swigCPtr, scale), false);
294 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
298 private bool EqualTo(Rotation rhs)
300 bool ret = NDalicPINVOKE.Rotation_EqualTo(swigCPtr, Rotation.getCPtr(rhs));
301 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
305 private bool NotEqualTo(Rotation rhs)
307 bool ret = NDalicPINVOKE.Rotation_NotEqualTo(swigCPtr, Rotation.getCPtr(rhs));
308 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
313 /// Returns the length of the rotation
315 /// <returns>The length of the rotation</returns>
316 public float Length()
318 float ret = NDalicPINVOKE.Rotation_Length(swigCPtr);
319 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
324 /// Returns the squared length of the rotation
326 /// <returns>The squared length of the rotation</returns>
327 public float LengthSquared()
329 float ret = NDalicPINVOKE.Rotation_LengthSquared(swigCPtr);
330 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
335 /// Normalizes this to unit length.
337 public void Normalize()
339 NDalicPINVOKE.Rotation_Normalize(swigCPtr);
340 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
346 /// <returns>A normalized version of this rotation</returns>
347 public Rotation Normalized()
349 Rotation ret = new Rotation(NDalicPINVOKE.Rotation_Normalized(swigCPtr), true);
350 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
355 /// Conjugates this rotation.
357 public void Conjugate()
359 NDalicPINVOKE.Rotation_Conjugate(swigCPtr);
360 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
364 /// Inverts this rotation.
368 NDalicPINVOKE.Rotation_Invert(swigCPtr);
369 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
373 /// Performs the logarithm of a rotation
375 /// <returns>A rotation representing the logarithm</returns>
376 public Rotation Log()
378 Rotation ret = new Rotation(NDalicPINVOKE.Rotation_Log(swigCPtr), true);
379 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
384 /// Performs an exponent
386 /// <returns>A rotation representing the exponent</returns>
387 public Rotation Exp()
389 Rotation ret = new Rotation(NDalicPINVOKE.Rotation_Exp(swigCPtr), true);
390 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
395 /// Returns the dot product of two rotations.
397 /// <param name="q1">The first rotation</param>
398 /// <param name="q2">The second rotation</param>
399 /// <returns>The dot product of the two rotations</returns>
400 public static float Dot(Rotation q1, Rotation q2)
402 float ret = NDalicPINVOKE.Rotation_Dot(Rotation.getCPtr(q1), Rotation.getCPtr(q2));
403 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
408 /// Linear Interpolation (using a straight line between the two rotations).
410 /// <param name="q1">The start rotation</param>
411 /// <param name="q2">The end rotation</param>
412 /// <param name="t">A progress value between 0 and 1</param>
413 /// <returns>The interpolated rotation</returns>
414 public static Rotation Lerp(Rotation q1, Rotation q2, float t)
416 Rotation ret = new Rotation(NDalicPINVOKE.Rotation_Lerp(Rotation.getCPtr(q1), Rotation.getCPtr(q2), t), true);
417 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
422 /// Spherical Linear Interpolation (using the shortest arc of a great circle between the two rotations).
424 /// <param name="q1">The start rotation</param>
425 /// <param name="q2">The end rotation</param>
426 /// <param name="progress">A progress value between 0 and 1</param>
427 /// <returns>The interpolated rotation</returns>
428 public static Rotation Slerp(Rotation q1, Rotation q2, float progress)
430 Rotation ret = new Rotation(NDalicPINVOKE.Rotation_Slerp(Rotation.getCPtr(q1), Rotation.getCPtr(q2), progress), true);
431 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
436 /// This version of Slerp, used by Squad, does not check for theta > 90.
438 /// <param name="q1">The start rotation</param>
439 /// <param name="q2">The end rotation</param>
440 /// <param name="t">A progress value between 0 and 1</param>
441 /// <returns>The interpolated rotation</returns>
442 public static Rotation SlerpNoInvert(Rotation q1, Rotation q2, float t)
444 Rotation ret = new Rotation(NDalicPINVOKE.Rotation_SlerpNoInvert(Rotation.getCPtr(q1), Rotation.getCPtr(q2), t), true);
445 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
450 /// Spherical Cubic Interpolation.
452 /// <param name="start">The start rotation</param>
453 /// <param name="end">The end rotation</param>
454 /// <param name="ctrl1">The control rotation for q1</param>
455 /// <param name="ctrl2">The control rotation for q2</param>
456 /// <param name="t">A progress value between 0 and 1</param>
457 /// <returns>The interpolated rotation</returns>
458 public static Rotation Squad(Rotation start, Rotation end, Rotation ctrl1, Rotation ctrl2, float t)
460 Rotation ret = new Rotation(NDalicPINVOKE.Rotation_Squad(Rotation.getCPtr(start), Rotation.getCPtr(end), Rotation.getCPtr(ctrl1), Rotation.getCPtr(ctrl2), t), true);
461 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
466 /// Returns the shortest angle between two rotations in Radians.
468 /// <param name="q1">The first rotation</param>
469 /// <param name="q2">The second rotation</param>
470 /// <returns>The angle between the two rotation</returns>
471 public static float AngleBetween(Rotation q1, Rotation q2)
473 float ret = NDalicPINVOKE.Rotation_AngleBetween(Rotation.getCPtr(q1), Rotation.getCPtr(q2));
474 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();