84906983fc2f3899b10dd68e54a8c98bbf3aeab6
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / Vector3.cs
1 /*
2  * Copyright(c) 2019 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17 using System;
18 using Tizen.NUI.Binding;
19
20 namespace Tizen.NUI
21 {
22
23     /// <summary>
24     /// A three-dimensional vector.
25     /// </summary>
26     /// <since_tizen> 3 </since_tizen>
27     [TypeConverter(typeof(Vector3TypeConverter))]
28     public class Vector3 : Disposable
29     {
30         /// <summary>
31         /// swigCMemOwn.
32         /// </summary>
33         /// <since_tizen> 3 </since_tizen>
34         protected bool swigCMemOwn;
35         private global::System.Runtime.InteropServices.HandleRef swigCPtr;
36
37         /// <summary>
38         /// The constructor.
39         /// </summary>
40         /// <since_tizen> 3 </since_tizen>
41         public Vector3() : this(Interop.Vector3.new_Vector3__SWIG_0(), true)
42         {
43             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
44         }
45
46         /// <summary>
47         /// The default constructor initializes the vector to 0.
48         /// </summary>
49         /// <param name="x">The x (or width) component.</param>
50         /// <param name="y">The y (or height) component.</param>
51         /// <param name="z">The z (or depth) component.</param>
52         /// <since_tizen> 3 </since_tizen>
53         public Vector3(float x, float y, float z) : this(Interop.Vector3.new_Vector3__SWIG_1(x, y, z), true)
54         {
55             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
56         }
57
58         /// <summary>
59         /// Conversion constructor from an array of three floats.
60         /// </summary>
61         /// <param name="array">An array of xyz.</param>
62         /// <since_tizen> 3 </since_tizen>
63         public Vector3(float[] array) : this(Interop.Vector3.new_Vector3__SWIG_2(array), true)
64         {
65             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
66         }
67
68         /// <summary>
69         /// The constructor.
70         /// </summary>
71         /// <param name="vec2">Vector2 to create this vector from.</param>
72         /// <since_tizen> 3 </since_tizen>
73         public Vector3(Vector2 vec2) : this(Interop.Vector3.new_Vector3__SWIG_3(Vector2.getCPtr(vec2)), true)
74         {
75             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
76         }
77
78         /// <summary>
79         /// The constructor.
80         /// </summary>
81         /// <param name="vec4">Vector4 to create this vector from.</param>
82         /// <since_tizen> 3 </since_tizen>
83         public Vector3(Vector4 vec4) : this(Interop.Vector3.new_Vector3__SWIG_4(Vector4.getCPtr(vec4)), true)
84         {
85             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
86         }
87
88         internal Vector3(global::System.IntPtr cPtr, bool cMemoryOwn)
89         {
90             swigCMemOwn = cMemoryOwn;
91             swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
92         }
93
94         internal Vector3(Vector3ChangedCallback cb, float x, float y, float z) : this(Interop.Vector3.new_Vector3__SWIG_1(x, y, z), true)
95         {
96             callback = cb;
97             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
98         }
99         internal delegate void Vector3ChangedCallback(float x, float y, float z);
100         private Vector3ChangedCallback callback = null;
101
102         /// <summary>
103         /// (1.0f,1.0f,1.0f).
104         /// </summary>
105         /// <since_tizen> 3 </since_tizen>
106         public static Vector3 One
107         {
108             get
109             {
110                 global::System.IntPtr cPtr = Interop.Vector3.Vector3_ONE_get();
111                 Vector3 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector3(cPtr, false);
112                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
113                 return ret;
114             }
115         }
116
117         /// <summary>
118         /// The vector representing the x-axis.
119         /// </summary>
120         /// <since_tizen> 3 </since_tizen>
121         public static Vector3 XAxis
122         {
123             get
124             {
125                 global::System.IntPtr cPtr = Interop.Vector3.Vector3_XAXIS_get();
126                 Vector3 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector3(cPtr, false);
127                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
128                 return ret;
129             }
130         }
131
132         /// <summary>
133         /// The vector representing the y-axis.
134         /// </summary>
135         /// <since_tizen> 3 </since_tizen>
136         public static Vector3 YAxis
137         {
138             get
139             {
140                 global::System.IntPtr cPtr = Interop.Vector3.Vector3_YAXIS_get();
141                 Vector3 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector3(cPtr, false);
142                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
143                 return ret;
144             }
145         }
146
147         /// <summary>
148         /// The vector representing the z-axis.
149         /// </summary>
150         /// <since_tizen> 3 </since_tizen>
151         public static Vector3 ZAxis
152         {
153             get
154             {
155                 global::System.IntPtr cPtr = Interop.Vector3.Vector3_ZAXIS_get();
156                 Vector3 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector3(cPtr, false);
157                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
158                 return ret;
159             }
160         }
161
162         /// <summary>
163         /// The vector representing the negative x-axis.
164         /// </summary>
165         /// <since_tizen> 3 </since_tizen>
166         public static Vector3 NegativeXAxis
167         {
168             get
169             {
170                 global::System.IntPtr cPtr = Interop.Vector3.Vector3_NEGATIVE_XAXIS_get();
171                 Vector3 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector3(cPtr, false);
172                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
173                 return ret;
174             }
175         }
176
177         /// <summary>
178         /// Th vector representing the negative y-axis.
179         /// </summary>
180         /// <since_tizen> 3 </since_tizen>
181         public static Vector3 NegativeYAxis
182         {
183             get
184             {
185                 global::System.IntPtr cPtr = Interop.Vector3.Vector3_NEGATIVE_YAXIS_get();
186                 Vector3 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector3(cPtr, false);
187                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
188                 return ret;
189             }
190         }
191
192         /// <summary>
193         /// The vector representing the negative z-axis.
194         /// </summary>
195         /// <since_tizen> 3 </since_tizen>
196         public static Vector3 NegativeZAxis
197         {
198             get
199             {
200                 global::System.IntPtr cPtr = Interop.Vector3.Vector3_NEGATIVE_ZAXIS_get();
201                 Vector3 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector3(cPtr, false);
202                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
203                 return ret;
204             }
205         }
206
207         /// <summary>
208         /// (0.0f, 0.0f, 0.0f).
209         /// </summary>
210         /// <since_tizen> 3 </since_tizen>
211         public static Vector3 Zero
212         {
213             get
214             {
215                 global::System.IntPtr cPtr = Interop.Vector3.Vector3_ZERO_get();
216                 Vector3 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector3(cPtr, false);
217                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
218                 return ret;
219             }
220         }
221
222         /// <summary>
223         /// The x component.
224         /// </summary>
225         /// <since_tizen> 3 </since_tizen>
226         public float X
227         {
228             set
229             {
230                 Interop.Vector3.Vector3_X_set(swigCPtr, value);
231                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
232
233                 callback?.Invoke(X, Y, Z);
234             }
235             get
236             {
237                 float ret = Interop.Vector3.Vector3_X_get(swigCPtr);
238                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
239                 return ret;
240             }
241         }
242
243         /// <summary>
244         /// The width component.
245         /// </summary>
246         /// <since_tizen> 3 </since_tizen>
247         public float Width
248         {
249             set
250             {
251                 Interop.Vector3.Vector3_Width_set(swigCPtr, value);
252                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
253
254                 callback?.Invoke(X, Y, Z);
255             }
256             get
257             {
258                 float ret = Interop.Vector3.Vector3_Width_get(swigCPtr);
259                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
260                 return ret;
261             }
262         }
263
264         /// <summary>
265         /// The red component.
266         /// </summary>
267         /// <since_tizen> 3 </since_tizen>
268         public float R
269         {
270             set
271             {
272                 Interop.Vector3.Vector3_r_set(swigCPtr, value);
273                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
274
275                 callback?.Invoke(X, Y, Z);
276             }
277             get
278             {
279                 float ret = Interop.Vector3.Vector3_r_get(swigCPtr);
280                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
281                 return ret;
282             }
283         }
284
285         /// <summary>
286         /// The y component.
287         /// </summary>
288         /// <since_tizen> 3 </since_tizen>
289         public float Y
290         {
291             set
292             {
293                 Interop.Vector3.Vector3_Y_set(swigCPtr, value);
294                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
295
296                 callback?.Invoke(X, Y, Z);
297             }
298             get
299             {
300                 float ret = Interop.Vector3.Vector3_Y_get(swigCPtr);
301                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
302                 return ret;
303             }
304         }
305
306         /// <summary>
307         /// The height component.
308         /// </summary>
309         /// <since_tizen> 3 </since_tizen>
310         public float Height
311         {
312             set
313             {
314                 Interop.Vector3.Vector3_Height_set(swigCPtr, value);
315                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
316
317                 callback?.Invoke(X, Y, Z);
318             }
319             get
320             {
321                 float ret = Interop.Vector3.Vector3_Height_get(swigCPtr);
322                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
323                 return ret;
324             }
325         }
326
327         /// <summary>
328         /// The green component.
329         /// </summary>
330         /// <since_tizen> 3 </since_tizen>
331         public float G
332         {
333             set
334             {
335                 Interop.Vector3.Vector3_g_set(swigCPtr, value);
336                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
337
338                 callback?.Invoke(X, Y, Z);
339             }
340             get
341             {
342                 float ret = Interop.Vector3.Vector3_g_get(swigCPtr);
343                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
344                 return ret;
345             }
346         }
347
348         /// <summary>
349         /// The z component.
350         /// </summary>
351         /// <since_tizen> 3 </since_tizen>
352         public float Z
353         {
354             set
355             {
356                 Interop.Vector3.Vector3_Z_set(swigCPtr, value);
357                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
358
359                 callback?.Invoke(X, Y, Z);
360             }
361             get
362             {
363                 float ret = Interop.Vector3.Vector3_Z_get(swigCPtr);
364                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
365                 return ret;
366             }
367         }
368
369         /// <summary>
370         /// The depth component.
371         /// </summary>
372         /// <since_tizen> 3 </since_tizen>
373         public float Depth
374         {
375             set
376             {
377                 Interop.Vector3.Vector3_Depth_set(swigCPtr, value);
378                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
379
380                 callback?.Invoke(X, Y, Z);
381             }
382             get
383             {
384                 float ret = Interop.Vector3.Vector3_Depth_get(swigCPtr);
385                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
386                 return ret;
387             }
388         }
389
390         /// <summary>
391         /// The blue component.
392         /// </summary>
393         /// <since_tizen> 3 </since_tizen>
394         public float B
395         {
396             set
397             {
398                 Interop.Vector3.Vector3_b_set(swigCPtr, value);
399                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
400
401                 callback?.Invoke(X, Y, Z);
402             }
403             get
404             {
405                 float ret = Interop.Vector3.Vector3_b_get(swigCPtr);
406                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
407                 return ret;
408             }
409         }
410
411         /// <summary>
412         /// An array subscript operator overload.
413         /// </summary>
414         /// <param name="index">The subscript index.</param>
415         /// <returns>The float at the given index.</returns>
416         /// <since_tizen> 3 </since_tizen>
417         public float this[uint index]
418         {
419             get
420             {
421                 return ValueOfIndex(index);
422             }
423         }
424
425         /// <summary>
426         /// The addition operator.
427         /// </summary>
428         /// <param name="arg1">The first value.</param>
429         /// <param name="arg2">The second value.</param>
430         /// <returns>The vector containing the result of the addition.</returns>
431         /// <since_tizen> 3 </since_tizen>
432         public static Vector3 operator +(Vector3 arg1, Vector3 arg2)
433         {
434             return arg1.Add(arg2);
435         }
436
437         /// <summary>
438         /// The subtraction operator.
439         /// </summary>
440         /// <param name="arg1">The first value.</param>
441         /// <param name="arg2">The second value.</param>
442         /// <returns>The vector containing the result of the subtraction.</returns>
443         /// <since_tizen> 3 </since_tizen>
444         public static Vector3 operator -(Vector3 arg1, Vector3 arg2)
445         {
446             return arg1.Subtract(arg2);
447         }
448
449         /// <summary>
450         /// The unary negation operator.
451         /// </summary>
452         /// <param name="arg1">The target value.</param>
453         /// <returns>The vector containg the negation.</returns>
454         /// <since_tizen> 3 </since_tizen>
455         public static Vector3 operator -(Vector3 arg1)
456         {
457             return arg1.Subtract();
458         }
459
460         /// <summary>
461         /// The multiplication operator.
462         /// </summary>
463         /// <param name="arg1">The first value.</param>
464         /// <param name="arg2">The second value.</param>
465         /// <returns>The vector containing the result of the multiplication.</returns>
466         /// <since_tizen> 3 </since_tizen>
467         public static Vector3 operator *(Vector3 arg1, Vector3 arg2)
468         {
469             return arg1.Multiply(arg2);
470         }
471
472         /// <summary>
473         /// The multiplication operator.
474         /// </summary>
475         /// <param name="arg1">The first value.</param>
476         /// <param name="arg2">The float value to scale the vector.</param>
477         /// <returns>The vector containing the result of the scaling.</returns>
478         /// <since_tizen> 3 </since_tizen>
479         public static Vector3 operator *(Vector3 arg1, float arg2)
480         {
481             return arg1.Multiply(arg2);
482         }
483
484         /// <summary>
485         /// The division operator.
486         /// </summary>
487         /// <param name="arg1">The first value.</param>
488         /// <param name="arg2">The second value.</param>
489         /// <returns>The vector containing the result of the division.</returns>
490         /// <since_tizen> 3 </since_tizen>
491         public static Vector3 operator /(Vector3 arg1, Vector3 arg2)
492         {
493             return arg1.Divide(arg2);
494         }
495
496         /// <summary>
497         /// The division operator.
498         /// </summary>
499         /// <param name="arg1">The first value.</param>
500         /// <param name="arg2">The float value to scale the vector by.</param>
501         /// <returns>The vector containing the result of the scaling.</returns>
502         /// <since_tizen> 3 </since_tizen>
503         public static Vector3 operator /(Vector3 arg1, float arg2)
504         {
505             return arg1.Divide(arg2);
506         }
507
508         /// <summary>
509         /// Determines whether the specified object is equal to the current object.
510         /// </summary>
511         /// <param name="obj">The object to compare with the current object.</param>
512         /// <returns>true if the specified object is equal to the current object; otherwise, false.</returns>
513         public override bool Equals(System.Object obj)
514         {
515             Vector3 vector3 = obj as Vector3;
516             bool equal = false;
517             if (X == vector3?.X && Y == vector3?.Y && Z == vector3?.Z)
518             {
519                 equal = true;
520             }
521             return equal;
522         }
523
524         /// <summary>
525         /// Gets the the hash code of this Vector3.
526         /// </summary>
527         /// <returns>The Hash Code.</returns>
528         /// <since_tizen> 6 </since_tizen>
529         public override int GetHashCode()
530         {
531             return swigCPtr.Handle.GetHashCode();
532         }
533
534         /// <summary>
535         /// Returns the length of the vector.
536         /// </summary>
537         /// <returns>The length of the vector.</returns>
538         /// <since_tizen> 3 </since_tizen>
539         public float Length()
540         {
541             float ret = Interop.Vector3.Vector3_Length(swigCPtr);
542             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
543             return ret;
544         }
545
546         /// <summary>
547         /// Returns the length of the vector squared.<br />
548         /// This is more efficient than Length() for threshold
549         /// testing as it avoids the use of a square root.<br />
550         /// </summary>
551         /// <returns>The length of the vector squared.</returns>
552         /// <since_tizen> 3 </since_tizen>
553         public float LengthSquared()
554         {
555             float ret = Interop.Vector3.Vector3_LengthSquared(swigCPtr);
556             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
557             return ret;
558         }
559
560         /// <summary>
561         /// Sets the vector to be unit length, whilst maintaining its direction.
562         /// </summary>
563         /// <since_tizen> 3 </since_tizen>
564         public void Normalize()
565         {
566             Interop.Vector3.Vector3_Normalize(swigCPtr);
567             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
568         }
569
570         /// <summary>
571         /// Clamps the vector between minimum and maximum vectors.
572         /// </summary>
573         /// <param name="min">The minimum vector.</param>
574         /// <param name="max">The maximum vector.</param>
575         /// <since_tizen> 3 </since_tizen>
576         public void Clamp(Vector3 min, Vector3 max)
577         {
578             Interop.Vector3.Vector3_Clamp(swigCPtr, Vector3.getCPtr(min), Vector3.getCPtr(max));
579             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
580         }
581
582         /// <summary>
583         /// Returns the x and y components (or width and height, or r and g) as a Vector2.
584         /// </summary>
585         /// <returns>The partial vector contents as Vector2 (x,y).</returns>
586         /// <since_tizen> 3 </since_tizen>
587         public Vector2 GetVectorXY()
588         {
589             Vector2 ret = new Vector2(Interop.Vector3.Vector3_GetVectorXY__SWIG_0(swigCPtr), false);
590             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
591             return ret;
592         }
593
594         /// <summary>
595         /// Returns the y and z components (or height and depth, or g and b) as a Vector2.
596         /// </summary>
597         /// <returns>The partial vector contents as Vector2 (y,z).</returns>
598         /// <since_tizen> 3 </since_tizen>
599         public Vector2 GetVectorYZ()
600         {
601             Vector2 ret = new Vector2(Interop.Vector3.Vector3_GetVectorYZ__SWIG_0(swigCPtr), false);
602             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
603             return ret;
604         }
605
606         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Vector3 obj)
607         {
608             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
609         }
610
611         internal static Vector3 GetVector3FromPtr(global::System.IntPtr cPtr)
612         {
613             Vector3 ret = new Vector3(cPtr, false);
614             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
615             return ret;
616         }
617
618         internal SWIGTYPE_p_float AsFloat()
619         {
620             global::System.IntPtr cPtr = Interop.Vector3.Vector3_AsFloat__SWIG_0(swigCPtr);
621             SWIGTYPE_p_float ret = (cPtr == global::System.IntPtr.Zero) ? null : new SWIGTYPE_p_float(cPtr, false);
622             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
623             return ret;
624         }
625
626         /// <summary>
627         /// Dispose.
628         /// </summary>
629         /// <param name="type">The dispose type</param>
630         /// <since_tizen> 3 </since_tizen>
631         protected override void Dispose(DisposeTypes type)
632         {
633             if (disposed)
634             {
635                 return;
636             }
637
638             //Release your own unmanaged resources here.
639             //You should not access any managed member here except static instance.
640             //because the execution order of Finalizes is non-deterministic.
641
642             if (swigCPtr.Handle != global::System.IntPtr.Zero)
643             {
644                 if (swigCMemOwn)
645                 {
646                     swigCMemOwn = false;
647                     Interop.Vector3.delete_Vector3(swigCPtr);
648                 }
649                 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
650             }
651             base.Dispose(type);
652         }
653
654         private Vector3 Add(Vector3 rhs)
655         {
656             Vector3 ret = new Vector3(Interop.Vector3.Vector3_Add(swigCPtr, Vector3.getCPtr(rhs)), true);
657             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
658             return ret;
659         }
660
661         private Vector3 AddAssign(Vector3 rhs)
662         {
663             Vector3 ret = new Vector3(Interop.Vector3.Vector3_AddAssign(swigCPtr, Vector3.getCPtr(rhs)), false);
664             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
665             return ret;
666         }
667
668         private Vector3 Subtract(Vector3 rhs)
669         {
670             Vector3 ret = new Vector3(Interop.Vector3.Vector3_Subtract__SWIG_0(swigCPtr, Vector3.getCPtr(rhs)), true);
671             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
672             return ret;
673         }
674
675         private Vector3 SubtractAssign(Vector3 rhs)
676         {
677             Vector3 ret = new Vector3(Interop.Vector3.Vector3_SubtractAssign(swigCPtr, Vector3.getCPtr(rhs)), false);
678             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
679             return ret;
680         }
681
682         private Vector3 Multiply(Vector3 rhs)
683         {
684             Vector3 ret = new Vector3(Interop.Vector3.Vector3_Multiply__SWIG_0(swigCPtr, Vector3.getCPtr(rhs)), true);
685             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
686             return ret;
687         }
688
689         private Vector3 Multiply(float rhs)
690         {
691             Vector3 ret = new Vector3(Interop.Vector3.Vector3_Multiply__SWIG_1(swigCPtr, rhs), true);
692             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
693             return ret;
694         }
695
696         private Vector3 MultiplyAssign(Vector3 rhs)
697         {
698             Vector3 ret = new Vector3(Interop.Vector3.Vector3_MultiplyAssign__SWIG_0(swigCPtr, Vector3.getCPtr(rhs)), false);
699             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
700             return ret;
701         }
702
703         private Vector3 MultiplyAssign(float rhs)
704         {
705             Vector3 ret = new Vector3(Interop.Vector3.Vector3_MultiplyAssign__SWIG_1(swigCPtr, rhs), false);
706             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
707             return ret;
708         }
709
710         private Vector3 MultiplyAssign(Rotation rhs)
711         {
712             Vector3 ret = new Vector3(Interop.Vector3.Vector3_MultiplyAssign__SWIG_2(swigCPtr, Rotation.getCPtr(rhs)), false);
713             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
714             return ret;
715         }
716
717         private Vector3 Divide(Vector3 rhs)
718         {
719             Vector3 ret = new Vector3(Interop.Vector3.Vector3_Divide__SWIG_0(swigCPtr, Vector3.getCPtr(rhs)), true);
720             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
721             return ret;
722         }
723
724         private Vector3 Divide(float rhs)
725         {
726             Vector3 ret = new Vector3(Interop.Vector3.Vector3_Divide__SWIG_1(swigCPtr, rhs), true);
727             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
728             return ret;
729         }
730
731         private Vector3 DivideAssign(Vector3 rhs)
732         {
733             Vector3 ret = new Vector3(Interop.Vector3.Vector3_DivideAssign__SWIG_0(swigCPtr, Vector3.getCPtr(rhs)), false);
734             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
735             return ret;
736         }
737
738         private Vector3 DivideAssign(float rhs)
739         {
740             Vector3 ret = new Vector3(Interop.Vector3.Vector3_DivideAssign__SWIG_1(swigCPtr, rhs), false);
741             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
742             return ret;
743         }
744
745         private Vector3 Subtract()
746         {
747             Vector3 ret = new Vector3(Interop.Vector3.Vector3_Subtract__SWIG_1(swigCPtr), true);
748             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
749             return ret;
750         }
751
752         private bool EqualTo(Vector3 rhs)
753         {
754             bool ret = Interop.Vector3.Vector3_EqualTo(swigCPtr, Vector3.getCPtr(rhs));
755             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
756             return ret;
757         }
758
759         private bool NotEqualTo(Vector3 rhs)
760         {
761             bool ret = Interop.Vector3.Vector3_NotEqualTo(swigCPtr, Vector3.getCPtr(rhs));
762             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
763             return ret;
764         }
765
766         private float ValueOfIndex(uint index)
767         {
768             float ret = Interop.Vector3.Vector3_ValueOfIndex__SWIG_0(swigCPtr, index);
769             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
770             return ret;
771         }
772
773         internal float Dot(Vector3 other)
774         {
775             float ret = Interop.Vector3.Vector3_Dot(swigCPtr, Vector3.getCPtr(other));
776             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
777             return ret;
778         }
779
780         internal Vector3 Cross(Vector3 other)
781         {
782             Vector3 ret = new Vector3(Interop.Vector3.Vector3_Cross(swigCPtr, Vector3.getCPtr(other)), true);
783             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
784             return ret;
785         }
786
787     }
788
789 }