manual nui merge 0.2.38
[platform/core/csapi/nui.git] / Tizen.NUI / src / public / Rotation.cs
1 //------------------------------------------------------------------------------
2 // <auto-generated />
3 //
4 // This file was automatically generated by SWIG (http://www.swig.org).
5 // Version 3.0.9
6 //
7 // Do not make changes to this file unless you know what you are doing--modify
8 // the SWIG interface file instead.
9 //------------------------------------------------------------------------------
10
11 namespace Tizen.NUI
12 {
13
14     /// <summary>
15     /// Rotation Class
16     /// </summary>
17     public class Rotation : global::System.IDisposable
18     {
19         private global::System.Runtime.InteropServices.HandleRef swigCPtr;
20         protected bool swigCMemOwn;
21
22         internal Rotation(global::System.IntPtr cPtr, bool cMemoryOwn)
23         {
24             swigCMemOwn = cMemoryOwn;
25             swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
26         }
27
28         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Rotation obj)
29         {
30             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
31         }
32
33         ~Rotation()
34         {
35             DisposeQueue.Instance.Add(this);
36         }
37
38         /// <summary>
39         /// To make Rotation instance be disposed.
40         /// </summary>
41         public virtual void Dispose()
42         {
43             if (!Window.IsInstalled())
44             {
45                 DisposeQueue.Instance.Add(this);
46                 return;
47             }
48
49             lock (this)
50             {
51                 if (swigCPtr.Handle != global::System.IntPtr.Zero)
52                 {
53                     if (swigCMemOwn)
54                     {
55                         swigCMemOwn = false;
56                         NDalicPINVOKE.delete_Rotation(swigCPtr);
57                     }
58                     swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
59                 }
60                 global::System.GC.SuppressFinalize(this);
61             }
62         }
63
64         /// <summary>
65         /// Addition operator.
66         /// </summary>
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)
71         {
72             return arg1.Add(arg2);
73         }
74
75         /// <summary>
76         /// Subtraction operator.
77         /// </summary>
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)
82         {
83             return arg1.Subtract(arg2);
84         }
85
86         /// <summary>
87         /// Unary Negation operator.
88         /// </summary>
89         /// <param name="arg1">First Rotation</param>
90         /// <returns>A Rotation containing the negated result</returns>
91         public static Rotation operator -(Rotation arg1)
92         {
93             return arg1.Subtract();
94         }
95
96         /// <summary>
97         /// Multiplication operator.
98         /// </summary>
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)
103         {
104             return arg1.Multiply(arg2);
105         }
106
107         /// <summary>
108         /// Multiplication operator.
109         /// </summary>
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)
114         {
115             return arg1.Multiply(arg2);
116         }
117
118         /// <summary>
119         /// Scale operator.
120         /// </summary>
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)
125         {
126             return arg1.Multiply(arg2);
127         }
128
129         /// <summary>
130         /// Division operator.
131         /// </summary>
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)
136         {
137             return arg1.Divide(arg2);
138         }
139
140         /// <summary>
141         /// Scale operator.
142         /// </summary>
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)
147         {
148             return arg1.Divide(arg2);
149         }
150
151         /// <summary>
152         /// Default Constructor.
153         /// </summary>
154         public Rotation() : this(NDalicPINVOKE.new_Rotation__SWIG_0(), true)
155         {
156             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
157         }
158
159         /// <summary>
160         /// Constructor from an axis and angle.
161         /// </summary>
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)
165         {
166             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
167         }
168
169         /// <summary>
170         /// (0.0f,0.0f,0.0f,1.0f)
171         /// </summary>
172         public static Rotation IDENTITY
173         {
174             get
175             {
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();
179                 return ret;
180             }
181         }
182
183         /// <summary>
184         /// Helper to check if this is an identity quaternion.
185         /// </summary>
186         /// <returns>True if this is identity quaternion</returns>
187         public bool IsIdentity()
188         {
189             bool ret = NDalicPINVOKE.Rotation_IsIdentity(swigCPtr);
190             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
191             return ret;
192         }
193
194         /// <summary>
195         /// Converts the quaternion to an axis/angle pair.
196         /// </summary>
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)
201         {
202             bool ret = NDalicPINVOKE.Rotation_GetAxisAngle(swigCPtr, Vector3.getCPtr(axis), Radian.getCPtr(angle));
203             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
204             return ret;
205         }
206
207         private Rotation Add(Rotation other)
208         {
209             Rotation ret = new Rotation(NDalicPINVOKE.Rotation_Add(swigCPtr, Rotation.getCPtr(other)), true);
210             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
211             return ret;
212         }
213
214         private Rotation Subtract(Rotation other)
215         {
216             Rotation ret = new Rotation(NDalicPINVOKE.Rotation_Subtract__SWIG_0(swigCPtr, Rotation.getCPtr(other)), true);
217             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
218             return ret;
219         }
220
221         private Rotation Multiply(Rotation other)
222         {
223             Rotation ret = new Rotation(NDalicPINVOKE.Rotation_Multiply__SWIG_0(swigCPtr, Rotation.getCPtr(other)), true);
224             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
225             return ret;
226         }
227
228         private Vector3 Multiply(Vector3 other)
229         {
230             Vector3 ret = new Vector3(NDalicPINVOKE.Rotation_Multiply__SWIG_1(swigCPtr, Vector3.getCPtr(other)), true);
231             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
232             return ret;
233         }
234
235         private Rotation Divide(Rotation other)
236         {
237             Rotation ret = new Rotation(NDalicPINVOKE.Rotation_Divide__SWIG_0(swigCPtr, Rotation.getCPtr(other)), true);
238             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
239             return ret;
240         }
241
242         private Rotation Multiply(float scale)
243         {
244             Rotation ret = new Rotation(NDalicPINVOKE.Rotation_Multiply__SWIG_2(swigCPtr, scale), true);
245             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
246             return ret;
247         }
248
249         private Rotation Divide(float scale)
250         {
251             Rotation ret = new Rotation(NDalicPINVOKE.Rotation_Divide__SWIG_1(swigCPtr, scale), true);
252             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
253             return ret;
254         }
255
256         private Rotation Subtract()
257         {
258             Rotation ret = new Rotation(NDalicPINVOKE.Rotation_Subtract__SWIG_1(swigCPtr), true);
259             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
260             return ret;
261         }
262
263         private Rotation AddAssign(Rotation other)
264         {
265             Rotation ret = new Rotation(NDalicPINVOKE.Rotation_AddAssign(swigCPtr, Rotation.getCPtr(other)), false);
266             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
267             return ret;
268         }
269
270         private Rotation SubtractAssign(Rotation other)
271         {
272             Rotation ret = new Rotation(NDalicPINVOKE.Rotation_SubtractAssign(swigCPtr, Rotation.getCPtr(other)), false);
273             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
274             return ret;
275         }
276
277         private Rotation MultiplyAssign(Rotation other)
278         {
279             Rotation ret = new Rotation(NDalicPINVOKE.Rotation_MultiplyAssign__SWIG_0(swigCPtr, Rotation.getCPtr(other)), false);
280             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
281             return ret;
282         }
283
284         private Rotation MultiplyAssign(float scale)
285         {
286             Rotation ret = new Rotation(NDalicPINVOKE.Rotation_MultiplyAssign__SWIG_1(swigCPtr, scale), false);
287             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
288             return ret;
289         }
290
291         private Rotation DivideAssign(float scale)
292         {
293             Rotation ret = new Rotation(NDalicPINVOKE.Rotation_DivideAssign(swigCPtr, scale), false);
294             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
295             return ret;
296         }
297
298         private bool EqualTo(Rotation rhs)
299         {
300             bool ret = NDalicPINVOKE.Rotation_EqualTo(swigCPtr, Rotation.getCPtr(rhs));
301             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
302             return ret;
303         }
304
305         private bool NotEqualTo(Rotation rhs)
306         {
307             bool ret = NDalicPINVOKE.Rotation_NotEqualTo(swigCPtr, Rotation.getCPtr(rhs));
308             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
309             return ret;
310         }
311
312         /// <summary>
313         /// Returns the length of the rotation
314         /// </summary>
315         /// <returns>The length of the rotation</returns>
316         public float Length()
317         {
318             float ret = NDalicPINVOKE.Rotation_Length(swigCPtr);
319             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
320             return ret;
321         }
322
323         /// <summary>
324         /// Returns the squared length of the rotation
325         /// </summary>
326         /// <returns>The squared length of the rotation</returns>
327         public float LengthSquared()
328         {
329             float ret = NDalicPINVOKE.Rotation_LengthSquared(swigCPtr);
330             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
331             return ret;
332         }
333
334         /// <summary>
335         /// Normalizes this to unit length.
336         /// </summary>
337         public void Normalize()
338         {
339             NDalicPINVOKE.Rotation_Normalize(swigCPtr);
340             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
341         }
342
343         /// <summary>
344         /// Normalized.
345         /// </summary>
346         /// <returns>A normalized version of this rotation</returns>
347         public Rotation Normalized()
348         {
349             Rotation ret = new Rotation(NDalicPINVOKE.Rotation_Normalized(swigCPtr), true);
350             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
351             return ret;
352         }
353
354         /// <summary>
355         /// Conjugates this rotation.
356         /// </summary>
357         public void Conjugate()
358         {
359             NDalicPINVOKE.Rotation_Conjugate(swigCPtr);
360             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
361         }
362
363         /// <summary>
364         /// Inverts this rotation.
365         /// </summary>
366         public void Invert()
367         {
368             NDalicPINVOKE.Rotation_Invert(swigCPtr);
369             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
370         }
371
372         /// <summary>
373         /// Performs the logarithm of a rotation
374         /// </summary>
375         /// <returns>A rotation representing the logarithm</returns>
376         public Rotation Log()
377         {
378             Rotation ret = new Rotation(NDalicPINVOKE.Rotation_Log(swigCPtr), true);
379             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
380             return ret;
381         }
382
383         /// <summary>
384         /// Performs an exponent
385         /// </summary>
386         /// <returns>A rotation representing the exponent</returns>
387         public Rotation Exp()
388         {
389             Rotation ret = new Rotation(NDalicPINVOKE.Rotation_Exp(swigCPtr), true);
390             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
391             return ret;
392         }
393
394         /// <summary>
395         /// Returns the dot product of two rotations.
396         /// </summary>
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)
401         {
402             float ret = NDalicPINVOKE.Rotation_Dot(Rotation.getCPtr(q1), Rotation.getCPtr(q2));
403             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
404             return ret;
405         }
406
407         /// <summary>
408         /// Linear Interpolation (using a straight line between the two rotations).
409         /// </summary>
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)
415         {
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();
418             return ret;
419         }
420
421         /// <summary>
422         /// Spherical Linear Interpolation (using the shortest arc of a great circle between the two rotations).
423         /// </summary>
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)
429         {
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();
432             return ret;
433         }
434
435         /// <summary>
436         /// This version of Slerp, used by Squad, does not check for theta > 90.
437         /// </summary>
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)
443         {
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();
446             return ret;
447         }
448
449         /// <summary>
450         /// Spherical Cubic Interpolation.
451         /// </summary>
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)
459         {
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();
462             return ret;
463         }
464
465         /// <summary>
466         /// Returns the shortest angle between two rotations in Radians.
467         /// </summary>
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)
472         {
473             float ret = NDalicPINVOKE.Rotation_AngleBetween(Rotation.getCPtr(q1), Rotation.getCPtr(q2));
474             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
475             return ret;
476         }
477
478     }
479
480 }