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 //------------------------------------------------------------------------------
15 /// A three dimensional vector.
17 public class Vector3 : global::System.IDisposable
19 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
20 protected bool swigCMemOwn;
22 internal Vector3(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(Vector3 obj)
30 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
33 //NUI Dispose Pattern written by Jinwoo Nam(jjw.nam)
35 //A Flag to check who called Dispose(). (By User or DisposeQueue)
36 private bool isDisposeQueued = false;
37 //A Flat to check if it is already disposed.
38 protected bool disposed = false;
44 isDisposeQueued = true;
45 DisposeQueue.Instance.Add(this);
51 //Throw excpetion if Dispose() is called in separate thread.
52 if (!Window.IsInstalled())
54 throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread.");
59 Dispose(DisposeTypes.Implicit);
63 Dispose(DisposeTypes.Explicit);
64 System.GC.SuppressFinalize(this);
68 protected virtual void Dispose(DisposeTypes type)
75 if(type == DisposeTypes.Explicit)
78 //Release your own managed resources here.
79 //You should release all of your own disposable objects here.
82 //Release your own unmanaged resources here.
83 //You should not access any managed member here except static instance.
84 //because the execution order of Finalizes is non-deterministic.
86 if (swigCPtr.Handle != global::System.IntPtr.Zero)
91 NDalicPINVOKE.delete_Vector3(swigCPtr);
93 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
99 /// Addition operator.
101 /// <param name="arg1">First Value</param>
102 /// <param name="arg2">Second Value</param>
103 /// <returns>A vector containing the result of the addition</returns>
104 public static Vector3 operator +(Vector3 arg1, Vector3 arg2)
106 return arg1.Add(arg2);
110 /// Subtraction operator.
112 /// <param name="arg1">First Value</param>
113 /// <param name="arg2">Second Value</param>
114 /// <returns>A vector containing the result of the subtraction</returns>
115 public static Vector3 operator -(Vector3 arg1, Vector3 arg2)
117 return arg1.Subtract(arg2);
121 /// Unary negation operator.
123 /// <param name="arg1">Target Value</param>
124 /// <returns>A vector containg the negation</returns>
125 public static Vector3 operator -(Vector3 arg1)
127 return arg1.Subtract();
131 /// Multiplication operator.
133 /// <param name="arg1">First Value</param>
134 /// <param name="arg2">Second Value</param>
135 /// <returns>A vector containing the result of the multiplication</returns>
136 public static Vector3 operator *(Vector3 arg1, Vector3 arg2)
138 return arg1.Multiply(arg2);
142 /// Multiplication operator.
144 /// <param name="arg1">First Value</param>
145 /// <param name="arg2">The float value to scale the vector</param>
146 /// <returns>A vector containing the result of the scaling</returns>
147 public static Vector3 operator *(Vector3 arg1, float arg2)
149 return arg1.Multiply(arg2);
153 /// Division operator.
155 /// <param name="arg1">First Value</param>
156 /// <param name="arg2">Second Value</param>
157 /// <returns>A vector containing the result of the division</returns>
158 public static Vector3 operator /(Vector3 arg1, Vector3 arg2)
160 return arg1.Divide(arg2);
164 /// Division operator.
166 /// <param name="arg1">First Value</param>
167 /// <param name="arg2">The float value to scale the vector by</param>
168 /// <returns>A vector containing the result of the scaling</returns>
169 public static Vector3 operator /(Vector3 arg1, float arg2)
171 return arg1.Divide(arg2);
175 /// Array subscript operator overload.
177 /// <param name="index">Subscript index</param>
178 /// <returns>The float at the given index</returns>
179 public float this[uint index]
183 return ValueOfIndex(index);
187 internal static Vector3 GetVector3FromPtr(global::System.IntPtr cPtr)
189 Vector3 ret = new Vector3(cPtr, false);
190 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
197 public Vector3() : this(NDalicPINVOKE.new_Vector3__SWIG_0(), true)
199 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
203 /// Default constructor, initializes the vector to 0.
205 /// <param name="x">x (or width) component</param>
206 /// <param name="y">y (or height) component</param>
207 /// <param name="z">z (or depth) component</param>
208 public Vector3(float x, float y, float z) : this(NDalicPINVOKE.new_Vector3__SWIG_1(x, y, z), true)
210 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
214 /// Conversion constructor from an array of three floats.
216 /// <param name="array">Array of xyz</param>
217 public Vector3(float[] array) : this(NDalicPINVOKE.new_Vector3__SWIG_2(array), true)
219 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
225 /// <param name="vec2">Vector2 to create this vector from</param>
226 public Vector3(Vector2 vec2) : this(NDalicPINVOKE.new_Vector3__SWIG_3(Vector2.getCPtr(vec2)), true)
228 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
234 /// <param name="vec4">Vector4 to create this vector from</param>
235 public Vector3(Vector4 vec4) : this(NDalicPINVOKE.new_Vector3__SWIG_4(Vector4.getCPtr(vec4)), true)
237 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
243 public static Vector3 One
247 global::System.IntPtr cPtr = NDalicPINVOKE.Vector3_ONE_get();
248 Vector3 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector3(cPtr, false);
249 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
255 /// Vector representing the X axis
257 public static Vector3 XAxis
261 global::System.IntPtr cPtr = NDalicPINVOKE.Vector3_XAXIS_get();
262 Vector3 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector3(cPtr, false);
263 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
269 /// Vector representing the Y axis
271 public static Vector3 YAxis
275 global::System.IntPtr cPtr = NDalicPINVOKE.Vector3_YAXIS_get();
276 Vector3 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector3(cPtr, false);
277 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
283 /// Vector representing the Z axis
285 public static Vector3 ZAxis
289 global::System.IntPtr cPtr = NDalicPINVOKE.Vector3_ZAXIS_get();
290 Vector3 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector3(cPtr, false);
291 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
297 /// Vector representing the negative X axis
299 public static Vector3 NegativeXAxis
303 global::System.IntPtr cPtr = NDalicPINVOKE.Vector3_NEGATIVE_XAXIS_get();
304 Vector3 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector3(cPtr, false);
305 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
311 /// Vector representing the negative Y axis
313 public static Vector3 NegativeYAxis
317 global::System.IntPtr cPtr = NDalicPINVOKE.Vector3_NEGATIVE_YAXIS_get();
318 Vector3 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector3(cPtr, false);
319 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
325 /// Vector representing the negative Z axis
327 public static Vector3 NegativeZAxis
331 global::System.IntPtr cPtr = NDalicPINVOKE.Vector3_NEGATIVE_ZAXIS_get();
332 Vector3 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector3(cPtr, false);
333 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
339 /// (0.0f, 0.0f, 0.0f)
341 public static Vector3 Zero
345 global::System.IntPtr cPtr = NDalicPINVOKE.Vector3_ZERO_get();
346 Vector3 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector3(cPtr, false);
347 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
352 private Vector3 Add(Vector3 rhs)
354 Vector3 ret = new Vector3(NDalicPINVOKE.Vector3_Add(swigCPtr, Vector3.getCPtr(rhs)), true);
355 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
359 private Vector3 AddAssign(Vector3 rhs)
361 Vector3 ret = new Vector3(NDalicPINVOKE.Vector3_AddAssign(swigCPtr, Vector3.getCPtr(rhs)), false);
362 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
366 private Vector3 Subtract(Vector3 rhs)
368 Vector3 ret = new Vector3(NDalicPINVOKE.Vector3_Subtract__SWIG_0(swigCPtr, Vector3.getCPtr(rhs)), true);
369 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
373 private Vector3 SubtractAssign(Vector3 rhs)
375 Vector3 ret = new Vector3(NDalicPINVOKE.Vector3_SubtractAssign(swigCPtr, Vector3.getCPtr(rhs)), false);
376 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
380 private Vector3 Multiply(Vector3 rhs)
382 Vector3 ret = new Vector3(NDalicPINVOKE.Vector3_Multiply__SWIG_0(swigCPtr, Vector3.getCPtr(rhs)), true);
383 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
387 private Vector3 Multiply(float rhs)
389 Vector3 ret = new Vector3(NDalicPINVOKE.Vector3_Multiply__SWIG_1(swigCPtr, rhs), true);
390 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
394 private Vector3 MultiplyAssign(Vector3 rhs)
396 Vector3 ret = new Vector3(NDalicPINVOKE.Vector3_MultiplyAssign__SWIG_0(swigCPtr, Vector3.getCPtr(rhs)), false);
397 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
401 private Vector3 MultiplyAssign(float rhs)
403 Vector3 ret = new Vector3(NDalicPINVOKE.Vector3_MultiplyAssign__SWIG_1(swigCPtr, rhs), false);
404 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
408 private Vector3 MultiplyAssign(Rotation rhs)
410 Vector3 ret = new Vector3(NDalicPINVOKE.Vector3_MultiplyAssign__SWIG_2(swigCPtr, Rotation.getCPtr(rhs)), false);
411 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
415 private Vector3 Divide(Vector3 rhs)
417 Vector3 ret = new Vector3(NDalicPINVOKE.Vector3_Divide__SWIG_0(swigCPtr, Vector3.getCPtr(rhs)), true);
418 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
422 private Vector3 Divide(float rhs)
424 Vector3 ret = new Vector3(NDalicPINVOKE.Vector3_Divide__SWIG_1(swigCPtr, rhs), true);
425 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
429 private Vector3 DivideAssign(Vector3 rhs)
431 Vector3 ret = new Vector3(NDalicPINVOKE.Vector3_DivideAssign__SWIG_0(swigCPtr, Vector3.getCPtr(rhs)), false);
432 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
436 private Vector3 DivideAssign(float rhs)
438 Vector3 ret = new Vector3(NDalicPINVOKE.Vector3_DivideAssign__SWIG_1(swigCPtr, rhs), false);
439 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
443 private Vector3 Subtract()
445 Vector3 ret = new Vector3(NDalicPINVOKE.Vector3_Subtract__SWIG_1(swigCPtr), true);
446 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
450 private bool EqualTo(Vector3 rhs)
452 bool ret = NDalicPINVOKE.Vector3_EqualTo(swigCPtr, Vector3.getCPtr(rhs));
453 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
457 private bool NotEqualTo(Vector3 rhs)
459 bool ret = NDalicPINVOKE.Vector3_NotEqualTo(swigCPtr, Vector3.getCPtr(rhs));
460 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
464 private float ValueOfIndex(uint index)
466 float ret = NDalicPINVOKE.Vector3_ValueOfIndex__SWIG_0(swigCPtr, index);
467 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
471 internal float Dot(Vector3 other)
473 float ret = NDalicPINVOKE.Vector3_Dot(swigCPtr, Vector3.getCPtr(other));
474 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
478 internal Vector3 Cross(Vector3 other)
480 Vector3 ret = new Vector3(NDalicPINVOKE.Vector3_Cross(swigCPtr, Vector3.getCPtr(other)), true);
481 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
486 /// Returns the length of the vector.
488 /// <returns>The length of the vector</returns>
489 public float Length()
491 float ret = NDalicPINVOKE.Vector3_Length(swigCPtr);
492 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
497 /// Returns the length of the vector squared.<br>
498 /// This is more efficient than Length() for threshold
499 /// testing as it avoids the use of a square root.<br>
501 /// <returns>The length of the vector squared</returns>
502 public float LengthSquared()
504 float ret = NDalicPINVOKE.Vector3_LengthSquared(swigCPtr);
505 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
510 /// Sets the vector to be unit length, whilst maintaining its direction.
512 public void Normalize()
514 NDalicPINVOKE.Vector3_Normalize(swigCPtr);
515 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
519 /// Clamps the vector between minimum and maximum vectors.
521 /// <param name="min">The minimum vector</param>
522 /// <param name="max">The maximum vector</param>
523 public void Clamp(Vector3 min, Vector3 max)
525 NDalicPINVOKE.Vector3_Clamp(swigCPtr, Vector3.getCPtr(min), Vector3.getCPtr(max));
526 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
529 internal SWIGTYPE_p_float AsFloat()
531 global::System.IntPtr cPtr = NDalicPINVOKE.Vector3_AsFloat__SWIG_0(swigCPtr);
532 SWIGTYPE_p_float ret = (cPtr == global::System.IntPtr.Zero) ? null : new SWIGTYPE_p_float(cPtr, false);
533 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
538 /// Returns the x & y components (or width & height, or r & g) as a Vector2.
540 /// <returns>The partial vector contents as Vector2 (x,y)</returns>
541 public Vector2 GetVectorXY()
543 Vector2 ret = new Vector2(NDalicPINVOKE.Vector3_GetVectorXY__SWIG_0(swigCPtr), false);
544 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
549 /// Returns the y & z components (or height & depth, or g & b) as a Vector2.
551 /// <returns>The partial vector contents as Vector2 (y,z)</returns>
552 public Vector2 GetVectorYZ()
554 Vector2 ret = new Vector2(NDalicPINVOKE.Vector3_GetVectorYZ__SWIG_0(swigCPtr), false);
555 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
566 NDalicPINVOKE.Vector3_X_set(swigCPtr, value);
567 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
571 float ret = NDalicPINVOKE.Vector3_X_get(swigCPtr);
572 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
584 NDalicPINVOKE.Vector3_Width_set(swigCPtr, value);
585 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
589 float ret = NDalicPINVOKE.Vector3_Width_get(swigCPtr);
590 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
602 NDalicPINVOKE.Vector3_r_set(swigCPtr, value);
603 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
607 float ret = NDalicPINVOKE.Vector3_r_get(swigCPtr);
608 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
620 NDalicPINVOKE.Vector3_Y_set(swigCPtr, value);
621 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
625 float ret = NDalicPINVOKE.Vector3_Y_get(swigCPtr);
626 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
638 NDalicPINVOKE.Vector3_Height_set(swigCPtr, value);
639 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
643 float ret = NDalicPINVOKE.Vector3_Height_get(swigCPtr);
644 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
656 NDalicPINVOKE.Vector3_g_set(swigCPtr, value);
657 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
661 float ret = NDalicPINVOKE.Vector3_g_get(swigCPtr);
662 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
674 NDalicPINVOKE.Vector3_Z_set(swigCPtr, value);
675 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
679 float ret = NDalicPINVOKE.Vector3_Z_get(swigCPtr);
680 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
692 NDalicPINVOKE.Vector3_Depth_set(swigCPtr, value);
693 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
697 float ret = NDalicPINVOKE.Vector3_Depth_get(swigCPtr);
698 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
710 NDalicPINVOKE.Vector3_b_set(swigCPtr, value);
711 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
715 float ret = NDalicPINVOKE.Vector3_b_get(swigCPtr);
716 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();