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 four dimensional vector.
17 public class Vector4 : global::System.IDisposable
19 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
20 protected bool swigCMemOwn;
22 internal Vector4(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(Vector4 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_Vector4(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 Vector4 operator +(Vector4 arg1, Vector4 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 Vector4 operator -(Vector4 arg1, Vector4 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 Vector4 operator -(Vector4 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 Vector4 operator *(Vector4 arg1, Vector4 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 Vector4 operator *(Vector4 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 Vector4 operator /(Vector4 arg1, Vector4 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 Vector4 operator /(Vector4 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 Vector4 GetVector4FromPtr(global::System.IntPtr cPtr)
152 Vector4 ret = new Vector4(cPtr, false);
153 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
158 /// Default constructor, initializes the vector to 0.
160 public Vector4() : this(NDalicPINVOKE.new_Vector4__SWIG_0(), true)
162 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
166 /// Conversion constructor from four floats.
168 /// <param name="x">x (or r/s) component</param>
169 /// <param name="y">y (or g/t) component</param>
170 /// <param name="z">z (or b/p) component</param>
171 /// <param name="w">w (or a/q) component</param>
172 public Vector4(float x, float y, float z, float w) : this(NDalicPINVOKE.new_Vector4__SWIG_1(x, y, z, w), true)
174 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
178 /// Conversion constructor from an array of four floats.
180 /// <param name="array">array Array of either xyzw/rgba/stpq</param>
181 public Vector4(float[] array) : this(NDalicPINVOKE.new_Vector4__SWIG_2(array), true)
183 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
187 /// Conversion constructor from Vector2.
189 /// <param name="vec2">Vector2 to copy from, z and w are initialized to 0</param>
190 public Vector4(Vector2 vec2) : this(NDalicPINVOKE.new_Vector4__SWIG_3(Vector2.getCPtr(vec2)), true)
192 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
196 /// Conversion constructor from Vector3.
198 /// <param name="vec3">Vector3 to copy from, w is initialized to 0</param>
199 public Vector4(Vector3 vec3) : this(NDalicPINVOKE.new_Vector4__SWIG_4(Vector3.getCPtr(vec3)), true)
201 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
205 /// (1.0f,1.0f,1.0f,1.0f)
207 public static Vector4 One
211 global::System.IntPtr cPtr = NDalicPINVOKE.Vector4_ONE_get();
212 Vector4 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector4(cPtr, false);
213 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
219 /// (1.0f,0.0f,0.0f,0.0f)
221 public static Vector4 XAxis
225 global::System.IntPtr cPtr = NDalicPINVOKE.Vector4_XAXIS_get();
226 Vector4 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector4(cPtr, false);
227 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
233 /// (0.0f,1.0f,0.0f,0.0f)
235 public static Vector4 YAxis
239 global::System.IntPtr cPtr = NDalicPINVOKE.Vector4_YAXIS_get();
240 Vector4 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector4(cPtr, false);
241 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
247 /// (0.0f,0.0f,1.0f,0.0f)
249 public static Vector4 ZAxis
253 global::System.IntPtr cPtr = NDalicPINVOKE.Vector4_ZAXIS_get();
254 Vector4 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector4(cPtr, false);
255 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
261 /// (0.0f, 0.0f, 0.0f, 0.0f)
263 public static Vector4 Zero
267 global::System.IntPtr cPtr = NDalicPINVOKE.Vector4_ZERO_get();
268 Vector4 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector4(cPtr, false);
269 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
274 internal Vector4 Assign(float[] array)
276 Vector4 ret = new Vector4(NDalicPINVOKE.Vector4_Assign__SWIG_0(swigCPtr, array), false);
277 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
281 internal Vector4 Assign(Vector2 vec2)
283 Vector4 ret = new Vector4(NDalicPINVOKE.Vector4_Assign__SWIG_1(swigCPtr, Vector2.getCPtr(vec2)), false);
284 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
288 internal Vector4 Assign(Vector3 vec3)
290 Vector4 ret = new Vector4(NDalicPINVOKE.Vector4_Assign__SWIG_2(swigCPtr, Vector3.getCPtr(vec3)), false);
291 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
295 internal Vector4 Add(Vector4 rhs)
297 Vector4 ret = new Vector4(NDalicPINVOKE.Vector4_Add(swigCPtr, Vector4.getCPtr(rhs)), true);
298 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
302 internal Vector4 AddAssign(Vector4 rhs)
304 Vector4 ret = new Vector4(NDalicPINVOKE.Vector4_AddAssign(swigCPtr, Vector4.getCPtr(rhs)), false);
305 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
309 internal Vector4 Subtract(Vector4 rhs)
311 Vector4 ret = new Vector4(NDalicPINVOKE.Vector4_Subtract__SWIG_0(swigCPtr, Vector4.getCPtr(rhs)), true);
312 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
316 internal Vector4 SubtractAssign(Vector4 rhs)
318 Vector4 ret = new Vector4(NDalicPINVOKE.Vector4_SubtractAssign(swigCPtr, Vector4.getCPtr(rhs)), false);
319 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
323 internal Vector4 Multiply(Vector4 rhs)
325 Vector4 ret = new Vector4(NDalicPINVOKE.Vector4_Multiply__SWIG_0(swigCPtr, Vector4.getCPtr(rhs)), true);
326 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
330 internal Vector4 Multiply(float rhs)
332 Vector4 ret = new Vector4(NDalicPINVOKE.Vector4_Multiply__SWIG_1(swigCPtr, rhs), true);
333 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
337 internal Vector4 MultiplyAssign(Vector4 rhs)
339 Vector4 ret = new Vector4(NDalicPINVOKE.Vector4_MultiplyAssign__SWIG_0(swigCPtr, Vector4.getCPtr(rhs)), false);
340 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
344 internal Vector4 MultiplyAssign(float rhs)
346 Vector4 ret = new Vector4(NDalicPINVOKE.Vector4_MultiplyAssign__SWIG_1(swigCPtr, rhs), false);
347 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
351 internal Vector4 Divide(Vector4 rhs)
353 Vector4 ret = new Vector4(NDalicPINVOKE.Vector4_Divide__SWIG_0(swigCPtr, Vector4.getCPtr(rhs)), true);
354 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
358 internal Vector4 Divide(float rhs)
360 Vector4 ret = new Vector4(NDalicPINVOKE.Vector4_Divide__SWIG_1(swigCPtr, rhs), true);
361 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
365 internal Vector4 DivideAssign(Vector4 rhs)
367 Vector4 ret = new Vector4(NDalicPINVOKE.Vector4_DivideAssign__SWIG_0(swigCPtr, Vector4.getCPtr(rhs)), false);
368 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
372 internal Vector4 DivideAssign(float rhs)
374 Vector4 ret = new Vector4(NDalicPINVOKE.Vector4_DivideAssign__SWIG_1(swigCPtr, rhs), false);
375 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
379 internal Vector4 Subtract()
381 Vector4 ret = new Vector4(NDalicPINVOKE.Vector4_Subtract__SWIG_1(swigCPtr), true);
382 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
386 internal bool EqualTo(Vector4 rhs)
388 bool ret = NDalicPINVOKE.Vector4_EqualTo(swigCPtr, Vector4.getCPtr(rhs));
389 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
393 internal bool NotEqualTo(Vector4 rhs)
395 bool ret = NDalicPINVOKE.Vector4_NotEqualTo(swigCPtr, Vector4.getCPtr(rhs));
396 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
400 internal float ValueOfIndex(uint index)
402 float ret = NDalicPINVOKE.Vector4_ValueOfIndex__SWIG_0(swigCPtr, index);
403 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
407 internal float Dot(Vector3 other)
409 float ret = NDalicPINVOKE.Vector4_Dot__SWIG_0(swigCPtr, Vector3.getCPtr(other));
410 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
414 internal float Dot(Vector4 other)
416 float ret = NDalicPINVOKE.Vector4_Dot__SWIG_1(swigCPtr, Vector4.getCPtr(other));
417 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
421 internal float Dot4(Vector4 other)
423 float ret = NDalicPINVOKE.Vector4_Dot4(swigCPtr, Vector4.getCPtr(other));
424 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
428 internal Vector4 Cross(Vector4 other)
430 Vector4 ret = new Vector4(NDalicPINVOKE.Vector4_Cross(swigCPtr, Vector4.getCPtr(other)), true);
431 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
436 /// Returns the length of the vector.
438 /// <returns>The length</returns>
439 public float Length()
441 float ret = NDalicPINVOKE.Vector4_Length(swigCPtr);
442 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
447 /// Returns the length of the vector squared.<br>
448 /// This is faster than using Length() when performing
449 /// threshold checks as it avoids use of the square root.<br>
451 /// <returns>The length of the vector squared</returns>
452 public float LengthSquared()
454 float ret = NDalicPINVOKE.Vector4_LengthSquared(swigCPtr);
455 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
460 /// Normalizes the vector.<br>
461 /// Sets the vector to unit length whilst maintaining its direction.<br>
463 public void Normalize()
465 NDalicPINVOKE.Vector4_Normalize(swigCPtr);
466 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
470 /// Clamps the vector between minimum and maximum vectors.
472 /// <param name="min">The minimum vector</param>
473 /// <param name="max">The maximum vector</param>
474 public void Clamp(Vector4 min, Vector4 max)
476 NDalicPINVOKE.Vector4_Clamp(swigCPtr, Vector4.getCPtr(min), Vector4.getCPtr(max));
477 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
480 internal SWIGTYPE_p_float AsFloat()
482 global::System.IntPtr cPtr = NDalicPINVOKE.Vector4_AsFloat__SWIG_0(swigCPtr);
483 SWIGTYPE_p_float ret = (cPtr == global::System.IntPtr.Zero) ? null : new SWIGTYPE_p_float(cPtr, false);
484 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
495 NDalicPINVOKE.Vector4_X_set(swigCPtr, value);
496 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
500 float ret = NDalicPINVOKE.Vector4_X_get(swigCPtr);
501 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
513 NDalicPINVOKE.Vector4_r_set(swigCPtr, value);
514 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
518 float ret = NDalicPINVOKE.Vector4_r_get(swigCPtr);
519 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
531 NDalicPINVOKE.Vector4_s_set(swigCPtr, value);
532 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
536 float ret = NDalicPINVOKE.Vector4_s_get(swigCPtr);
537 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
549 NDalicPINVOKE.Vector4_Y_set(swigCPtr, value);
550 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
554 float ret = NDalicPINVOKE.Vector4_Y_get(swigCPtr);
555 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
567 NDalicPINVOKE.Vector4_g_set(swigCPtr, value);
568 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
572 float ret = NDalicPINVOKE.Vector4_g_get(swigCPtr);
573 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
585 NDalicPINVOKE.Vector4_t_set(swigCPtr, value);
586 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
590 float ret = NDalicPINVOKE.Vector4_t_get(swigCPtr);
591 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
603 NDalicPINVOKE.Vector4_Z_set(swigCPtr, value);
604 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
608 float ret = NDalicPINVOKE.Vector4_Z_get(swigCPtr);
609 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
621 NDalicPINVOKE.Vector4_b_set(swigCPtr, value);
622 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
626 float ret = NDalicPINVOKE.Vector4_b_get(swigCPtr);
627 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
639 NDalicPINVOKE.Vector4_p_set(swigCPtr, value);
640 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
644 float ret = NDalicPINVOKE.Vector4_p_get(swigCPtr);
645 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
657 NDalicPINVOKE.Vector4_W_set(swigCPtr, value);
658 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
662 float ret = NDalicPINVOKE.Vector4_W_get(swigCPtr);
663 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
675 NDalicPINVOKE.Vector4_a_set(swigCPtr, value);
676 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
680 float ret = NDalicPINVOKE.Vector4_a_get(swigCPtr);
681 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
693 NDalicPINVOKE.Vector4_q_set(swigCPtr, value);
694 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
698 float ret = NDalicPINVOKE.Vector4_q_get(swigCPtr);
699 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();