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 //A Flag to check who called Dispose(). (By User or DisposeQueue)
34 private bool isDisposeQueued = false;
35 //A Flat to check if it is already disposed.
36 protected bool disposed = false;
42 isDisposeQueued = true;
43 DisposeQueue.Instance.Add(this);
49 //Throw excpetion if Dispose() is called in separate thread.
50 if (!Window.IsInstalled())
52 throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread.");
57 Dispose(DisposeTypes.Implicit);
61 Dispose(DisposeTypes.Explicit);
62 System.GC.SuppressFinalize(this);
66 protected virtual void Dispose(DisposeTypes type)
73 if(type == DisposeTypes.Explicit)
76 //Release your own managed resources here.
77 //You should release all of your own disposable objects here.
80 //Release your own unmanaged resources here.
81 //You should not access any managed member here except static instance.
82 //because the execution order of Finalizes is non-deterministic.
84 if (swigCPtr.Handle != global::System.IntPtr.Zero)
89 NDalicPINVOKE.delete_Vector3(swigCPtr);
91 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
97 /// Addition operator.
99 /// <param name="arg1">First Value</param>
100 /// <param name="arg2">Second Value</param>
101 /// <returns>A vector containing the result of the addition</returns>
102 public static Vector3 operator +(Vector3 arg1, Vector3 arg2)
104 return arg1.Add(arg2);
108 /// Subtraction operator.
110 /// <param name="arg1">First Value</param>
111 /// <param name="arg2">Second Value</param>
112 /// <returns>A vector containing the result of the subtraction</returns>
113 public static Vector3 operator -(Vector3 arg1, Vector3 arg2)
115 return arg1.Subtract(arg2);
119 /// Unary negation operator.
121 /// <param name="arg1">Target Value</param>
122 /// <returns>A vector containg the negation</returns>
123 public static Vector3 operator -(Vector3 arg1)
125 return arg1.Subtract();
129 /// Multiplication operator.
131 /// <param name="arg1">First Value</param>
132 /// <param name="arg2">Second Value</param>
133 /// <returns>A vector containing the result of the multiplication</returns>
134 public static Vector3 operator *(Vector3 arg1, Vector3 arg2)
136 return arg1.Multiply(arg2);
140 /// Multiplication operator.
142 /// <param name="arg1">First Value</param>
143 /// <param name="arg2">The float value to scale the vector</param>
144 /// <returns>A vector containing the result of the scaling</returns>
145 public static Vector3 operator *(Vector3 arg1, float arg2)
147 return arg1.Multiply(arg2);
151 /// Division operator.
153 /// <param name="arg1">First Value</param>
154 /// <param name="arg2">Second Value</param>
155 /// <returns>A vector containing the result of the division</returns>
156 public static Vector3 operator /(Vector3 arg1, Vector3 arg2)
158 return arg1.Divide(arg2);
162 /// Division operator.
164 /// <param name="arg1">First Value</param>
165 /// <param name="arg2">The float value to scale the vector by</param>
166 /// <returns>A vector containing the result of the scaling</returns>
167 public static Vector3 operator /(Vector3 arg1, float arg2)
169 return arg1.Divide(arg2);
173 /// Array subscript operator overload.
175 /// <param name="index">Subscript index</param>
176 /// <returns>The float at the given index</returns>
177 public float this[uint index]
181 return ValueOfIndex(index);
185 internal static Vector3 GetVector3FromPtr(global::System.IntPtr cPtr)
187 Vector3 ret = new Vector3(cPtr, false);
188 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
195 public Vector3() : this(NDalicPINVOKE.new_Vector3__SWIG_0(), true)
197 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
201 /// Default constructor, initializes the vector to 0.
203 /// <param name="x">x (or width) component</param>
204 /// <param name="y">y (or height) component</param>
205 /// <param name="z">z (or depth) component</param>
206 public Vector3(float x, float y, float z) : this(NDalicPINVOKE.new_Vector3__SWIG_1(x, y, z), true)
208 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
212 /// Conversion constructor from an array of three floats.
214 /// <param name="array">Array of xyz</param>
215 public Vector3(float[] array) : this(NDalicPINVOKE.new_Vector3__SWIG_2(array), true)
217 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
223 /// <param name="vec2">Vector2 to create this vector from</param>
224 public Vector3(Vector2 vec2) : this(NDalicPINVOKE.new_Vector3__SWIG_3(Vector2.getCPtr(vec2)), true)
226 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
232 /// <param name="vec4">Vector4 to create this vector from</param>
233 public Vector3(Vector4 vec4) : this(NDalicPINVOKE.new_Vector3__SWIG_4(Vector4.getCPtr(vec4)), true)
235 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
241 public static Vector3 One
245 global::System.IntPtr cPtr = NDalicPINVOKE.Vector3_ONE_get();
246 Vector3 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector3(cPtr, false);
247 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
253 /// Vector representing the X axis
255 public static Vector3 XAxis
259 global::System.IntPtr cPtr = NDalicPINVOKE.Vector3_XAXIS_get();
260 Vector3 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector3(cPtr, false);
261 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
267 /// Vector representing the Y axis
269 public static Vector3 YAxis
273 global::System.IntPtr cPtr = NDalicPINVOKE.Vector3_YAXIS_get();
274 Vector3 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector3(cPtr, false);
275 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
281 /// Vector representing the Z axis
283 public static Vector3 ZAxis
287 global::System.IntPtr cPtr = NDalicPINVOKE.Vector3_ZAXIS_get();
288 Vector3 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector3(cPtr, false);
289 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
295 /// Vector representing the negative X axis
297 public static Vector3 NegativeXAxis
301 global::System.IntPtr cPtr = NDalicPINVOKE.Vector3_NEGATIVE_XAXIS_get();
302 Vector3 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector3(cPtr, false);
303 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
309 /// Vector representing the negative Y axis
311 public static Vector3 NegativeYAxis
315 global::System.IntPtr cPtr = NDalicPINVOKE.Vector3_NEGATIVE_YAXIS_get();
316 Vector3 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector3(cPtr, false);
317 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
323 /// Vector representing the negative Z axis
325 public static Vector3 NegativeZAxis
329 global::System.IntPtr cPtr = NDalicPINVOKE.Vector3_NEGATIVE_ZAXIS_get();
330 Vector3 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector3(cPtr, false);
331 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
337 /// (0.0f, 0.0f, 0.0f)
339 public static Vector3 Zero
343 global::System.IntPtr cPtr = NDalicPINVOKE.Vector3_ZERO_get();
344 Vector3 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector3(cPtr, false);
345 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
350 private Vector3 Add(Vector3 rhs)
352 Vector3 ret = new Vector3(NDalicPINVOKE.Vector3_Add(swigCPtr, Vector3.getCPtr(rhs)), true);
353 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
357 private Vector3 AddAssign(Vector3 rhs)
359 Vector3 ret = new Vector3(NDalicPINVOKE.Vector3_AddAssign(swigCPtr, Vector3.getCPtr(rhs)), false);
360 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
364 private Vector3 Subtract(Vector3 rhs)
366 Vector3 ret = new Vector3(NDalicPINVOKE.Vector3_Subtract__SWIG_0(swigCPtr, Vector3.getCPtr(rhs)), true);
367 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
371 private Vector3 SubtractAssign(Vector3 rhs)
373 Vector3 ret = new Vector3(NDalicPINVOKE.Vector3_SubtractAssign(swigCPtr, Vector3.getCPtr(rhs)), false);
374 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
378 private Vector3 Multiply(Vector3 rhs)
380 Vector3 ret = new Vector3(NDalicPINVOKE.Vector3_Multiply__SWIG_0(swigCPtr, Vector3.getCPtr(rhs)), true);
381 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
385 private Vector3 Multiply(float rhs)
387 Vector3 ret = new Vector3(NDalicPINVOKE.Vector3_Multiply__SWIG_1(swigCPtr, rhs), true);
388 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
392 private Vector3 MultiplyAssign(Vector3 rhs)
394 Vector3 ret = new Vector3(NDalicPINVOKE.Vector3_MultiplyAssign__SWIG_0(swigCPtr, Vector3.getCPtr(rhs)), false);
395 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
399 private Vector3 MultiplyAssign(float rhs)
401 Vector3 ret = new Vector3(NDalicPINVOKE.Vector3_MultiplyAssign__SWIG_1(swigCPtr, rhs), false);
402 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
406 private Vector3 MultiplyAssign(Rotation rhs)
408 Vector3 ret = new Vector3(NDalicPINVOKE.Vector3_MultiplyAssign__SWIG_2(swigCPtr, Rotation.getCPtr(rhs)), false);
409 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
413 private Vector3 Divide(Vector3 rhs)
415 Vector3 ret = new Vector3(NDalicPINVOKE.Vector3_Divide__SWIG_0(swigCPtr, Vector3.getCPtr(rhs)), true);
416 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
420 private Vector3 Divide(float rhs)
422 Vector3 ret = new Vector3(NDalicPINVOKE.Vector3_Divide__SWIG_1(swigCPtr, rhs), true);
423 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
427 private Vector3 DivideAssign(Vector3 rhs)
429 Vector3 ret = new Vector3(NDalicPINVOKE.Vector3_DivideAssign__SWIG_0(swigCPtr, Vector3.getCPtr(rhs)), false);
430 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
434 private Vector3 DivideAssign(float rhs)
436 Vector3 ret = new Vector3(NDalicPINVOKE.Vector3_DivideAssign__SWIG_1(swigCPtr, rhs), false);
437 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
441 private Vector3 Subtract()
443 Vector3 ret = new Vector3(NDalicPINVOKE.Vector3_Subtract__SWIG_1(swigCPtr), true);
444 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
448 private bool EqualTo(Vector3 rhs)
450 bool ret = NDalicPINVOKE.Vector3_EqualTo(swigCPtr, Vector3.getCPtr(rhs));
451 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
455 private bool NotEqualTo(Vector3 rhs)
457 bool ret = NDalicPINVOKE.Vector3_NotEqualTo(swigCPtr, Vector3.getCPtr(rhs));
458 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
462 private float ValueOfIndex(uint index)
464 float ret = NDalicPINVOKE.Vector3_ValueOfIndex__SWIG_0(swigCPtr, index);
465 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
469 internal float Dot(Vector3 other)
471 float ret = NDalicPINVOKE.Vector3_Dot(swigCPtr, Vector3.getCPtr(other));
472 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
476 internal Vector3 Cross(Vector3 other)
478 Vector3 ret = new Vector3(NDalicPINVOKE.Vector3_Cross(swigCPtr, Vector3.getCPtr(other)), true);
479 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
484 /// Returns the length of the vector.
486 /// <returns>The length of the vector</returns>
487 public float Length()
489 float ret = NDalicPINVOKE.Vector3_Length(swigCPtr);
490 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
495 /// Returns the length of the vector squared.<br>
496 /// This is more efficient than Length() for threshold
497 /// testing as it avoids the use of a square root.<br>
499 /// <returns>The length of the vector squared</returns>
500 public float LengthSquared()
502 float ret = NDalicPINVOKE.Vector3_LengthSquared(swigCPtr);
503 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
508 /// Sets the vector to be unit length, whilst maintaining its direction.
510 public void Normalize()
512 NDalicPINVOKE.Vector3_Normalize(swigCPtr);
513 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
517 /// Clamps the vector between minimum and maximum vectors.
519 /// <param name="min">The minimum vector</param>
520 /// <param name="max">The maximum vector</param>
521 public void Clamp(Vector3 min, Vector3 max)
523 NDalicPINVOKE.Vector3_Clamp(swigCPtr, Vector3.getCPtr(min), Vector3.getCPtr(max));
524 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
527 internal SWIGTYPE_p_float AsFloat()
529 global::System.IntPtr cPtr = NDalicPINVOKE.Vector3_AsFloat__SWIG_0(swigCPtr);
530 SWIGTYPE_p_float ret = (cPtr == global::System.IntPtr.Zero) ? null : new SWIGTYPE_p_float(cPtr, false);
531 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
536 /// Returns the x & y components (or width & height, or r & g) as a Vector2.
538 /// <returns>The partial vector contents as Vector2 (x,y)</returns>
539 public Vector2 GetVectorXY()
541 Vector2 ret = new Vector2(NDalicPINVOKE.Vector3_GetVectorXY__SWIG_0(swigCPtr), false);
542 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
547 /// Returns the y & z components (or height & depth, or g & b) as a Vector2.
549 /// <returns>The partial vector contents as Vector2 (y,z)</returns>
550 public Vector2 GetVectorYZ()
552 Vector2 ret = new Vector2(NDalicPINVOKE.Vector3_GetVectorYZ__SWIG_0(swigCPtr), false);
553 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
564 NDalicPINVOKE.Vector3_X_set(swigCPtr, value);
565 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
569 float ret = NDalicPINVOKE.Vector3_X_get(swigCPtr);
570 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
582 NDalicPINVOKE.Vector3_Width_set(swigCPtr, value);
583 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
587 float ret = NDalicPINVOKE.Vector3_Width_get(swigCPtr);
588 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
600 NDalicPINVOKE.Vector3_r_set(swigCPtr, value);
601 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
605 float ret = NDalicPINVOKE.Vector3_r_get(swigCPtr);
606 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
618 NDalicPINVOKE.Vector3_Y_set(swigCPtr, value);
619 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
623 float ret = NDalicPINVOKE.Vector3_Y_get(swigCPtr);
624 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
636 NDalicPINVOKE.Vector3_Height_set(swigCPtr, value);
637 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
641 float ret = NDalicPINVOKE.Vector3_Height_get(swigCPtr);
642 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
654 NDalicPINVOKE.Vector3_g_set(swigCPtr, value);
655 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
659 float ret = NDalicPINVOKE.Vector3_g_get(swigCPtr);
660 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
672 NDalicPINVOKE.Vector3_Z_set(swigCPtr, value);
673 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
677 float ret = NDalicPINVOKE.Vector3_Z_get(swigCPtr);
678 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
690 NDalicPINVOKE.Vector3_Depth_set(swigCPtr, value);
691 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
695 float ret = NDalicPINVOKE.Vector3_Depth_get(swigCPtr);
696 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
708 NDalicPINVOKE.Vector3_b_set(swigCPtr, value);
709 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
713 float ret = NDalicPINVOKE.Vector3_b_get(swigCPtr);
714 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();