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;
35 DisposeQueue.Instance.Add(this);
38 public virtual void Dispose()
40 if (!Window.IsInstalled())
42 DisposeQueue.Instance.Add(this);
48 if (swigCPtr.Handle != global::System.IntPtr.Zero)
53 NDalicPINVOKE.delete_Vector3(swigCPtr);
55 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
57 global::System.GC.SuppressFinalize(this);
62 /// Addition operator.
64 /// <param name="arg1">First Value</param>
65 /// <param name="arg2">Second Value</param>
66 /// <returns>A vector containing the result of the addition</returns>
67 public static Vector3 operator +(Vector3 arg1, Vector3 arg2)
69 return arg1.Add(arg2);
73 /// Subtraction operator.
75 /// <param name="arg1">First Value</param>
76 /// <param name="arg2">Second Value</param>
77 /// <returns>A vector containing the result of the subtraction</returns>
78 public static Vector3 operator -(Vector3 arg1, Vector3 arg2)
80 return arg1.Subtract(arg2);
84 /// Unary negation operator.
86 /// <param name="arg1">Target Value</param>
87 /// <returns>A vector containg the negation</returns>
88 public static Vector3 operator -(Vector3 arg1)
90 return arg1.Subtract();
94 /// Multiplication operator.
96 /// <param name="arg1">First Value</param>
97 /// <param name="arg2">Second Value</param>
98 /// <returns>A vector containing the result of the multiplication</returns>
99 public static Vector3 operator *(Vector3 arg1, Vector3 arg2)
101 return arg1.Multiply(arg2);
105 /// Multiplication operator.
107 /// <param name="arg1">First Value</param>
108 /// <param name="arg2">The float value to scale the vector</param>
109 /// <returns>A vector containing the result of the scaling</returns>
110 public static Vector3 operator *(Vector3 arg1, float arg2)
112 return arg1.Multiply(arg2);
116 /// Division operator.
118 /// <param name="arg1">First Value</param>
119 /// <param name="arg2">Second Value</param>
120 /// <returns>A vector containing the result of the division</returns>
121 public static Vector3 operator /(Vector3 arg1, Vector3 arg2)
123 return arg1.Divide(arg2);
127 /// Division operator.
129 /// <param name="arg1">First Value</param>
130 /// <param name="arg2">The float value to scale the vector by</param>
131 /// <returns>A vector containing the result of the scaling</returns>
132 public static Vector3 operator /(Vector3 arg1, float arg2)
134 return arg1.Divide(arg2);
138 /// Array subscript operator overload.
140 /// <param name="index">Subscript index</param>
141 /// <returns>The float at the given index</returns>
142 public float this[uint index]
146 return ValueOfIndex(index);
150 internal static Vector3 GetVector3FromPtr(global::System.IntPtr cPtr)
152 Vector3 ret = new Vector3(cPtr, false);
153 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
160 public Vector3() : this(NDalicPINVOKE.new_Vector3__SWIG_0(), true)
162 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
166 /// Default constructor, initializes the vector to 0.
168 /// <param name="x">x (or width) component</param>
169 /// <param name="y">y (or height) component</param>
170 /// <param name="z">z (or depth) component</param>
171 public Vector3(float x, float y, float z) : this(NDalicPINVOKE.new_Vector3__SWIG_1(x, y, z), true)
173 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
177 /// Conversion constructor from an array of three floats.
179 /// <param name="array">Array of xyz</param>
180 public Vector3(float[] array) : this(NDalicPINVOKE.new_Vector3__SWIG_2(array), true)
182 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
188 /// <param name="vec2">Vector2 to create this vector from</param>
189 public Vector3(Vector2 vec2) : this(NDalicPINVOKE.new_Vector3__SWIG_3(Vector2.getCPtr(vec2)), true)
191 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
197 /// <param name="vec4">Vector4 to create this vector from</param>
198 public Vector3(Vector4 vec4) : this(NDalicPINVOKE.new_Vector3__SWIG_4(Vector4.getCPtr(vec4)), true)
200 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
206 public static Vector3 One
210 global::System.IntPtr cPtr = NDalicPINVOKE.Vector3_ONE_get();
211 Vector3 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector3(cPtr, false);
212 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
218 /// Vector representing the X axis
220 public static Vector3 XAxis
224 global::System.IntPtr cPtr = NDalicPINVOKE.Vector3_XAXIS_get();
225 Vector3 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector3(cPtr, false);
226 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
232 /// Vector representing the Y axis
234 public static Vector3 YAxis
238 global::System.IntPtr cPtr = NDalicPINVOKE.Vector3_YAXIS_get();
239 Vector3 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector3(cPtr, false);
240 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
246 /// Vector representing the Z axis
248 public static Vector3 ZAxis
252 global::System.IntPtr cPtr = NDalicPINVOKE.Vector3_ZAXIS_get();
253 Vector3 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector3(cPtr, false);
254 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
260 /// Vector representing the negative X axis
262 public static Vector3 NegativeXAxis
266 global::System.IntPtr cPtr = NDalicPINVOKE.Vector3_NEGATIVE_XAXIS_get();
267 Vector3 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector3(cPtr, false);
268 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
274 /// Vector representing the negative Y axis
276 public static Vector3 NegativeYAxis
280 global::System.IntPtr cPtr = NDalicPINVOKE.Vector3_NEGATIVE_YAXIS_get();
281 Vector3 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector3(cPtr, false);
282 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
288 /// Vector representing the negative Z axis
290 public static Vector3 NegativeZAxis
294 global::System.IntPtr cPtr = NDalicPINVOKE.Vector3_NEGATIVE_ZAXIS_get();
295 Vector3 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector3(cPtr, false);
296 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
302 /// (0.0f, 0.0f, 0.0f)
304 public static Vector3 Zero
308 global::System.IntPtr cPtr = NDalicPINVOKE.Vector3_ZERO_get();
309 Vector3 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector3(cPtr, false);
310 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
315 internal Vector3 Assign(float[] array)
317 Vector3 ret = new Vector3(NDalicPINVOKE.Vector3_Assign__SWIG_0(swigCPtr, array), false);
318 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
322 internal Vector3 Assign(Vector2 rhs)
324 Vector3 ret = new Vector3(NDalicPINVOKE.Vector3_Assign__SWIG_1(swigCPtr, Vector2.getCPtr(rhs)), false);
325 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
329 internal Vector3 Assign(Vector4 rhs)
331 Vector3 ret = new Vector3(NDalicPINVOKE.Vector3_Assign__SWIG_2(swigCPtr, Vector4.getCPtr(rhs)), false);
332 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
336 internal Vector3 Add(Vector3 rhs)
338 Vector3 ret = new Vector3(NDalicPINVOKE.Vector3_Add(swigCPtr, Vector3.getCPtr(rhs)), true);
339 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
343 internal Vector3 AddAssign(Vector3 rhs)
345 Vector3 ret = new Vector3(NDalicPINVOKE.Vector3_AddAssign(swigCPtr, Vector3.getCPtr(rhs)), false);
346 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
350 internal Vector3 Subtract(Vector3 rhs)
352 Vector3 ret = new Vector3(NDalicPINVOKE.Vector3_Subtract__SWIG_0(swigCPtr, Vector3.getCPtr(rhs)), true);
353 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
357 internal Vector3 SubtractAssign(Vector3 rhs)
359 Vector3 ret = new Vector3(NDalicPINVOKE.Vector3_SubtractAssign(swigCPtr, Vector3.getCPtr(rhs)), false);
360 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
364 internal Vector3 Multiply(Vector3 rhs)
366 Vector3 ret = new Vector3(NDalicPINVOKE.Vector3_Multiply__SWIG_0(swigCPtr, Vector3.getCPtr(rhs)), true);
367 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
371 internal Vector3 Multiply(float rhs)
373 Vector3 ret = new Vector3(NDalicPINVOKE.Vector3_Multiply__SWIG_1(swigCPtr, rhs), true);
374 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
378 internal Vector3 MultiplyAssign(Vector3 rhs)
380 Vector3 ret = new Vector3(NDalicPINVOKE.Vector3_MultiplyAssign__SWIG_0(swigCPtr, Vector3.getCPtr(rhs)), false);
381 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
385 internal Vector3 MultiplyAssign(float rhs)
387 Vector3 ret = new Vector3(NDalicPINVOKE.Vector3_MultiplyAssign__SWIG_1(swigCPtr, rhs), false);
388 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
392 internal Vector3 MultiplyAssign(Rotation rhs)
394 Vector3 ret = new Vector3(NDalicPINVOKE.Vector3_MultiplyAssign__SWIG_2(swigCPtr, Rotation.getCPtr(rhs)), false);
395 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
399 internal Vector3 Divide(Vector3 rhs)
401 Vector3 ret = new Vector3(NDalicPINVOKE.Vector3_Divide__SWIG_0(swigCPtr, Vector3.getCPtr(rhs)), true);
402 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
406 internal Vector3 Divide(float rhs)
408 Vector3 ret = new Vector3(NDalicPINVOKE.Vector3_Divide__SWIG_1(swigCPtr, rhs), true);
409 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
413 internal Vector3 DivideAssign(Vector3 rhs)
415 Vector3 ret = new Vector3(NDalicPINVOKE.Vector3_DivideAssign__SWIG_0(swigCPtr, Vector3.getCPtr(rhs)), false);
416 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
420 internal Vector3 DivideAssign(float rhs)
422 Vector3 ret = new Vector3(NDalicPINVOKE.Vector3_DivideAssign__SWIG_1(swigCPtr, rhs), false);
423 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
427 internal Vector3 Subtract()
429 Vector3 ret = new Vector3(NDalicPINVOKE.Vector3_Subtract__SWIG_1(swigCPtr), true);
430 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
434 internal bool EqualTo(Vector3 rhs)
436 bool ret = NDalicPINVOKE.Vector3_EqualTo(swigCPtr, Vector3.getCPtr(rhs));
437 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
441 internal bool NotEqualTo(Vector3 rhs)
443 bool ret = NDalicPINVOKE.Vector3_NotEqualTo(swigCPtr, Vector3.getCPtr(rhs));
444 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
448 internal float ValueOfIndex(uint index)
450 float ret = NDalicPINVOKE.Vector3_ValueOfIndex__SWIG_0(swigCPtr, index);
451 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
455 internal float Dot(Vector3 other)
457 float ret = NDalicPINVOKE.Vector3_Dot(swigCPtr, Vector3.getCPtr(other));
458 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
462 internal Vector3 Cross(Vector3 other)
464 Vector3 ret = new Vector3(NDalicPINVOKE.Vector3_Cross(swigCPtr, Vector3.getCPtr(other)), true);
465 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
470 /// Returns the length of the vector.
472 /// <returns>The length of the vector</returns>
473 public float Length()
475 float ret = NDalicPINVOKE.Vector3_Length(swigCPtr);
476 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
481 /// Returns the length of the vector squared.<br>
482 /// This is more efficient than Length() for threshold
483 /// testing as it avoids the use of a square root.<br>
485 /// <returns>The length of the vector squared</returns>
486 public float LengthSquared()
488 float ret = NDalicPINVOKE.Vector3_LengthSquared(swigCPtr);
489 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
494 /// Sets the vector to be unit length, whilst maintaining its direction.
496 public void Normalize()
498 NDalicPINVOKE.Vector3_Normalize(swigCPtr);
499 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
503 /// Clamps the vector between minimum and maximum vectors.
505 /// <param name="min">The minimum vector</param>
506 /// <param name="max">The maximum vector</param>
507 public void Clamp(Vector3 min, Vector3 max)
509 NDalicPINVOKE.Vector3_Clamp(swigCPtr, Vector3.getCPtr(min), Vector3.getCPtr(max));
510 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
513 internal SWIGTYPE_p_float AsFloat()
515 global::System.IntPtr cPtr = NDalicPINVOKE.Vector3_AsFloat__SWIG_0(swigCPtr);
516 SWIGTYPE_p_float ret = (cPtr == global::System.IntPtr.Zero) ? null : new SWIGTYPE_p_float(cPtr, false);
517 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
522 /// Returns the x & y components (or width & height, or r & g) as a Vector2.
524 /// <returns>The partial vector contents as Vector2 (x,y)</returns>
525 public Vector2 GetVectorXY()
527 Vector2 ret = new Vector2(NDalicPINVOKE.Vector3_GetVectorXY__SWIG_0(swigCPtr), false);
528 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
533 /// Returns the y & z components (or height & depth, or g & b) as a Vector2.
535 /// <returns>The partial vector contents as Vector2 (y,z)</returns>
536 public Vector2 GetVectorYZ()
538 Vector2 ret = new Vector2(NDalicPINVOKE.Vector3_GetVectorYZ__SWIG_0(swigCPtr), false);
539 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
550 NDalicPINVOKE.Vector3_X_set(swigCPtr, value);
551 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
555 float ret = NDalicPINVOKE.Vector3_X_get(swigCPtr);
556 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
568 NDalicPINVOKE.Vector3_Width_set(swigCPtr, value);
569 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
573 float ret = NDalicPINVOKE.Vector3_Width_get(swigCPtr);
574 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
586 NDalicPINVOKE.Vector3_r_set(swigCPtr, value);
587 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
591 float ret = NDalicPINVOKE.Vector3_r_get(swigCPtr);
592 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
604 NDalicPINVOKE.Vector3_Y_set(swigCPtr, value);
605 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
609 float ret = NDalicPINVOKE.Vector3_Y_get(swigCPtr);
610 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
622 NDalicPINVOKE.Vector3_Height_set(swigCPtr, value);
623 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
627 float ret = NDalicPINVOKE.Vector3_Height_get(swigCPtr);
628 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
640 NDalicPINVOKE.Vector3_g_set(swigCPtr, value);
641 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
645 float ret = NDalicPINVOKE.Vector3_g_get(swigCPtr);
646 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
658 NDalicPINVOKE.Vector3_Z_set(swigCPtr, value);
659 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
663 float ret = NDalicPINVOKE.Vector3_Z_get(swigCPtr);
664 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
676 NDalicPINVOKE.Vector3_Depth_set(swigCPtr, value);
677 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
681 float ret = NDalicPINVOKE.Vector3_Depth_get(swigCPtr);
682 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
694 NDalicPINVOKE.Vector3_b_set(swigCPtr, value);
695 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
699 float ret = NDalicPINVOKE.Vector3_b_get(swigCPtr);
700 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();