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