Subversion Repository Public Repository

Divide-Dependencies

This repository has no backups
This repository's network speed is throttled to 100KB/sec

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
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
/*
   Copyright (C) 2006, 2007 Sony Computer Entertainment Inc.
   All rights reserved.

   Redistribution and use in source and binary forms,
   with or without modification, are permitted provided that the
   following conditions are met:
    * Redistributions of source code must retain the above copyright
      notice, this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above copyright
      notice, this list of conditions and the following disclaimer in the
      documentation and/or other materials provided with the distribution.
    * Neither the name of the Sony Computer Entertainment Inc nor the names
      of its contributors may be used to endorse or promote products derived
      from this software without specific prior written permission.

   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
   AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
   IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
   ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
   LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
   CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
   SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
   INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
   CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
   ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
   POSSIBILITY OF SUCH DAMAGE.
*/

#ifndef _VECTORMATH_VEC_SOA_V_C_H
#define _VECTORMATH_VEC_SOA_V_C_H
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */

/*-----------------------------------------------------------------------------
 * Constants
 * for shuffles, words are labeled [x,y,z,w] [a,b,c,d]
 */
#define _VECTORMATH_SHUF_X 0x00010203
#define _VECTORMATH_SHUF_Y 0x04050607
#define _VECTORMATH_SHUF_Z 0x08090a0b
#define _VECTORMATH_SHUF_W 0x0c0d0e0f
#define _VECTORMATH_SHUF_A 0x10111213
#define _VECTORMATH_SHUF_B 0x14151617
#define _VECTORMATH_SHUF_C 0x18191a1b
#define _VECTORMATH_SHUF_D 0x1c1d1e1f
#define _VECTORMATH_SHUF_0 0x80808080
#define _VECTORMATH_SHUF_XAYB ((vec_uchar16)(vec_uint4){ _VECTORMATH_SHUF_X, _VECTORMATH_SHUF_A, _VECTORMATH_SHUF_Y, _VECTORMATH_SHUF_B })
#define _VECTORMATH_SHUF_ZCWD ((vec_uchar16)(vec_uint4){ _VECTORMATH_SHUF_Z, _VECTORMATH_SHUF_C, _VECTORMATH_SHUF_W, _VECTORMATH_SHUF_D })
#define _VECTORMATH_SHUF_ZBW0 ((vec_uchar16)(vec_uint4){ _VECTORMATH_SHUF_Z, _VECTORMATH_SHUF_B, _VECTORMATH_SHUF_W, _VECTORMATH_SHUF_0 })
#define _VECTORMATH_SHUF_XCY0 ((vec_uchar16)(vec_uint4){ _VECTORMATH_SHUF_X, _VECTORMATH_SHUF_C, _VECTORMATH_SHUF_Y, _VECTORMATH_SHUF_0 })
#define _VECTORMATH_SHUF_ZDW0 ((vec_uchar16)(vec_uint4){ _VECTORMATH_SHUF_Z, _VECTORMATH_SHUF_D, _VECTORMATH_SHUF_W, _VECTORMATH_SHUF_0 })
#define _VECTORMATH_SHUF_XAZC ((vec_uchar16)(vec_uint4){ _VECTORMATH_SHUF_X, _VECTORMATH_SHUF_A, _VECTORMATH_SHUF_Z, _VECTORMATH_SHUF_C })
#define _VECTORMATH_SHUF_ZDXB ((vec_uchar16)(vec_uint4){ _VECTORMATH_SHUF_Z, _VECTORMATH_SHUF_D, _VECTORMATH_SHUF_X, _VECTORMATH_SHUF_B })
#define _VECTORMATH_SHUF_YBWD ((vec_uchar16)(vec_uint4){ _VECTORMATH_SHUF_Y, _VECTORMATH_SHUF_B, _VECTORMATH_SHUF_W, _VECTORMATH_SHUF_D })
#define _VECTORMATH_SHUF_XDZB ((vec_uchar16)(vec_uint4){ _VECTORMATH_SHUF_X, _VECTORMATH_SHUF_D, _VECTORMATH_SHUF_Z, _VECTORMATH_SHUF_B })
#define _VECTORMATH_SHUF_YAWC ((vec_uchar16)(vec_uint4){ _VECTORMATH_SHUF_Y, _VECTORMATH_SHUF_A, _VECTORMATH_SHUF_W, _VECTORMATH_SHUF_C })
#define _VECTORMATH_SHUF_ZBXD ((vec_uchar16)(vec_uint4){ _VECTORMATH_SHUF_Z, _VECTORMATH_SHUF_B, _VECTORMATH_SHUF_X, _VECTORMATH_SHUF_D })
#define _VECTORMATH_SHUF_XYCD ((vec_uchar16)(vec_uint4){ _VECTORMATH_SHUF_X, _VECTORMATH_SHUF_Y, _VECTORMATH_SHUF_C, _VECTORMATH_SHUF_D })
#define _VECTORMATH_SLERP_TOL 0.999f

/*-----------------------------------------------------------------------------
 * Definitions
 */
#ifndef _VECTORMATH_INTERNAL_FUNCTIONS
#define _VECTORMATH_INTERNAL_FUNCTIONS

#endif

static inline VmathSoaVector3 vmathSoaV3MakeFromElems_V( vec_float4 _x, vec_float4 _y, vec_float4 _z )
{
    VmathSoaVector3 result;
    vmathSoaV3MakeFromElems(&result, _x, _y, _z);
    return result;
}

static inline VmathSoaVector3 vmathSoaV3MakeFromP3_V( VmathSoaPoint3 pnt )
{
    VmathSoaVector3 result;
    vmathSoaV3MakeFromP3(&result, &pnt);
    return result;
}

static inline VmathSoaVector3 vmathSoaV3MakeFromScalar_V( vec_float4 scalar )
{
    VmathSoaVector3 result;
    vmathSoaV3MakeFromScalar(&result, scalar);
    return result;
}

static inline VmathSoaVector3 vmathSoaV3MakeFromAos_V( VmathVector3 vec )
{
    VmathSoaVector3 result;
    vmathSoaV3MakeFromAos(&result, &vec);
    return result;
}

static inline VmathSoaVector3 vmathSoaV3MakeFrom4Aos_V( VmathVector3 vec0, VmathVector3 vec1, VmathVector3 vec2, VmathVector3 vec3 )
{
    VmathSoaVector3 result;
    vmathSoaV3MakeFrom4Aos(&result, &vec0, &vec1, &vec2, &vec3);
    return result;
}

static inline VmathSoaVector3 vmathSoaV3MakeXAxis_V( )
{
    VmathSoaVector3 result;
    vmathSoaV3MakeXAxis(&result);
    return result;
}

static inline VmathSoaVector3 vmathSoaV3MakeYAxis_V( )
{
    VmathSoaVector3 result;
    vmathSoaV3MakeYAxis(&result);
    return result;
}

static inline VmathSoaVector3 vmathSoaV3MakeZAxis_V( )
{
    VmathSoaVector3 result;
    vmathSoaV3MakeZAxis(&result);
    return result;
}

static inline VmathSoaVector3 vmathSoaV3Lerp_V( vec_float4 t, VmathSoaVector3 vec0, VmathSoaVector3 vec1 )
{
    VmathSoaVector3 result;
    vmathSoaV3Lerp(&result, t, &vec0, &vec1);
    return result;
}

static inline VmathSoaVector3 vmathSoaV3Slerp_V( vec_float4 t, VmathSoaVector3 unitVec0, VmathSoaVector3 unitVec1 )
{
    VmathSoaVector3 result;
    vmathSoaV3Slerp(&result, t, &unitVec0, &unitVec1);
    return result;
}

static inline void vmathSoaV3Get4Aos_V( VmathSoaVector3 vec, VmathVector3 *result0, VmathVector3 *result1, VmathVector3 *result2, VmathVector3 *result3 )
{
    vmathSoaV3Get4Aos(&vec, result0, result1, result2, result3);
}

static inline void vmathSoaV3LoadXYZArray_V( VmathSoaVector3 *vec, const vec_float4 *threeQuads )
{
    vmathSoaV3LoadXYZArray(vec, threeQuads);
}

static inline void vmathSoaV3StoreXYZArray_V( VmathSoaVector3 vec, vec_float4 *threeQuads )
{
    vmathSoaV3StoreXYZArray(&vec, threeQuads);
}

static inline void vmathSoaV3StoreHalfFloats_V( VmathSoaVector3 vec0, VmathSoaVector3 vec1, vec_ushort8 *threeQuads )
{
    vmathSoaV3StoreHalfFloats(&vec0, &vec1, threeQuads);
}

static inline void vmathSoaV3SetX_V( VmathSoaVector3 *result, vec_float4 _x )
{
    vmathSoaV3SetX(result, _x);
}

static inline vec_float4 vmathSoaV3GetX_V( VmathSoaVector3 vec )
{
    return vmathSoaV3GetX(&vec);
}

static inline void vmathSoaV3SetY_V( VmathSoaVector3 *result, vec_float4 _y )
{
    vmathSoaV3SetY(result, _y);
}

static inline vec_float4 vmathSoaV3GetY_V( VmathSoaVector3 vec )
{
    return vmathSoaV3GetY(&vec);
}

static inline void vmathSoaV3SetZ_V( VmathSoaVector3 *result, vec_float4 _z )
{
    vmathSoaV3SetZ(result, _z);
}

static inline vec_float4 vmathSoaV3GetZ_V( VmathSoaVector3 vec )
{
    return vmathSoaV3GetZ(&vec);
}

static inline void vmathSoaV3SetElem_V( VmathSoaVector3 *result, int idx, vec_float4 value )
{
    vmathSoaV3SetElem(result, idx, value);
}

static inline vec_float4 vmathSoaV3GetElem_V( VmathSoaVector3 vec, int idx )
{
    return vmathSoaV3GetElem(&vec, idx);
}

static inline VmathSoaVector3 vmathSoaV3Add_V( VmathSoaVector3 vec0, VmathSoaVector3 vec1 )
{
    VmathSoaVector3 result;
    vmathSoaV3Add(&result, &vec0, &vec1);
    return result;
}

static inline VmathSoaVector3 vmathSoaV3Sub_V( VmathSoaVector3 vec0, VmathSoaVector3 vec1 )
{
    VmathSoaVector3 result;
    vmathSoaV3Sub(&result, &vec0, &vec1);
    return result;
}

static inline VmathSoaPoint3 vmathSoaV3AddP3_V( VmathSoaVector3 vec, VmathSoaPoint3 pnt1 )
{
    VmathSoaPoint3 result;
    vmathSoaV3AddP3(&result, &vec, &pnt1);
    return result;
}

static inline VmathSoaVector3 vmathSoaV3ScalarMul_V( VmathSoaVector3 vec, vec_float4 scalar )
{
    VmathSoaVector3 result;
    vmathSoaV3ScalarMul(&result, &vec, scalar);
    return result;
}

static inline VmathSoaVector3 vmathSoaV3ScalarDiv_V( VmathSoaVector3 vec, vec_float4 scalar )
{
    VmathSoaVector3 result;
    vmathSoaV3ScalarDiv(&result, &vec, scalar);
    return result;
}

static inline VmathSoaVector3 vmathSoaV3Neg_V( VmathSoaVector3 vec )
{
    VmathSoaVector3 result;
    vmathSoaV3Neg(&result, &vec);
    return result;
}

static inline VmathSoaVector3 vmathSoaV3MulPerElem_V( VmathSoaVector3 vec0, VmathSoaVector3 vec1 )
{
    VmathSoaVector3 result;
    vmathSoaV3MulPerElem(&result, &vec0, &vec1);
    return result;
}

static inline VmathSoaVector3 vmathSoaV3DivPerElem_V( VmathSoaVector3 vec0, VmathSoaVector3 vec1 )
{
    VmathSoaVector3 result;
    vmathSoaV3DivPerElem(&result, &vec0, &vec1);
    return result;
}

static inline VmathSoaVector3 vmathSoaV3RecipPerElem_V( VmathSoaVector3 vec )
{
    VmathSoaVector3 result;
    vmathSoaV3RecipPerElem(&result, &vec);
    return result;
}

static inline VmathSoaVector3 vmathSoaV3SqrtPerElem_V( VmathSoaVector3 vec )
{
    VmathSoaVector3 result;
    vmathSoaV3SqrtPerElem(&result, &vec);
    return result;
}

static inline VmathSoaVector3 vmathSoaV3RsqrtPerElem_V( VmathSoaVector3 vec )
{
    VmathSoaVector3 result;
    vmathSoaV3RsqrtPerElem(&result, &vec);
    return result;
}

static inline VmathSoaVector3 vmathSoaV3AbsPerElem_V( VmathSoaVector3 vec )
{
    VmathSoaVector3 result;
    vmathSoaV3AbsPerElem(&result, &vec);
    return result;
}

static inline VmathSoaVector3 vmathSoaV3CopySignPerElem_V( VmathSoaVector3 vec0, VmathSoaVector3 vec1 )
{
    VmathSoaVector3 result;
    vmathSoaV3CopySignPerElem(&result, &vec0, &vec1);
    return result;
}

static inline VmathSoaVector3 vmathSoaV3MaxPerElem_V( VmathSoaVector3 vec0, VmathSoaVector3 vec1 )
{
    VmathSoaVector3 result;
    vmathSoaV3MaxPerElem(&result, &vec0, &vec1);
    return result;
}

static inline vec_float4 vmathSoaV3MaxElem_V( VmathSoaVector3 vec )
{
    return vmathSoaV3MaxElem(&vec);
}

static inline VmathSoaVector3 vmathSoaV3MinPerElem_V( VmathSoaVector3 vec0, VmathSoaVector3 vec1 )
{
    VmathSoaVector3 result;
    vmathSoaV3MinPerElem(&result, &vec0, &vec1);
    return result;
}

static inline vec_float4 vmathSoaV3MinElem_V( VmathSoaVector3 vec )
{
    return vmathSoaV3MinElem(&vec);
}

static inline vec_float4 vmathSoaV3Sum_V( VmathSoaVector3 vec )
{
    return vmathSoaV3Sum(&vec);
}

static inline vec_float4 vmathSoaV3Dot_V( VmathSoaVector3 vec0, VmathSoaVector3 vec1 )
{
    return vmathSoaV3Dot(&vec0, &vec1);
}

static inline vec_float4 vmathSoaV3LengthSqr_V( VmathSoaVector3 vec )
{
    return vmathSoaV3LengthSqr(&vec);
}

static inline vec_float4 vmathSoaV3Length_V( VmathSoaVector3 vec )
{
    return vmathSoaV3Length(&vec);
}

static inline VmathSoaVector3 vmathSoaV3Normalize_V( VmathSoaVector3 vec )
{
    VmathSoaVector3 result;
    vmathSoaV3Normalize(&result, &vec);
    return result;
}

static inline VmathSoaVector3 vmathSoaV3Cross_V( VmathSoaVector3 vec0, VmathSoaVector3 vec1 )
{
    VmathSoaVector3 result;
    vmathSoaV3Cross(&result, &vec0, &vec1);
    return result;
}

static inline VmathSoaVector3 vmathSoaV3Select_V( VmathSoaVector3 vec0, VmathSoaVector3 vec1, vec_uint4 select1 )
{
    VmathSoaVector3 result;
    vmathSoaV3Select(&result, &vec0, &vec1, select1);
    return result;
}

#ifdef _VECTORMATH_DEBUG

static inline void vmathSoaV3Print_V( VmathSoaVector3 vec )
{
    vmathSoaV3Print(&vec);
}

static inline void vmathSoaV3Prints_V( VmathSoaVector3 vec, const char *name )
{
    vmathSoaV3Prints(&vec, name);
}

#endif

static inline VmathSoaVector4 vmathSoaV4MakeFromElems_V( vec_float4 _x, vec_float4 _y, vec_float4 _z, vec_float4 _w )
{
    VmathSoaVector4 result;
    vmathSoaV4MakeFromElems(&result, _x, _y, _z, _w);
    return result;
}

static inline VmathSoaVector4 vmathSoaV4MakeFromV3Scalar_V( VmathSoaVector3 xyz, vec_float4 _w )
{
    VmathSoaVector4 result;
    vmathSoaV4MakeFromV3Scalar(&result, &xyz, _w);
    return result;
}

static inline VmathSoaVector4 vmathSoaV4MakeFromV3_V( VmathSoaVector3 vec )
{
    VmathSoaVector4 result;
    vmathSoaV4MakeFromV3(&result, &vec);
    return result;
}

static inline VmathSoaVector4 vmathSoaV4MakeFromP3_V( VmathSoaPoint3 pnt )
{
    VmathSoaVector4 result;
    vmathSoaV4MakeFromP3(&result, &pnt);
    return result;
}

static inline VmathSoaVector4 vmathSoaV4MakeFromQ_V( VmathSoaQuat quat )
{
    VmathSoaVector4 result;
    vmathSoaV4MakeFromQ(&result, &quat);
    return result;
}

static inline VmathSoaVector4 vmathSoaV4MakeFromScalar_V( vec_float4 scalar )
{
    VmathSoaVector4 result;
    vmathSoaV4MakeFromScalar(&result, scalar);
    return result;
}

static inline VmathSoaVector4 vmathSoaV4MakeFromAos_V( VmathVector4 vec )
{
    VmathSoaVector4 result;
    vmathSoaV4MakeFromAos(&result, &vec);
    return result;
}

static inline VmathSoaVector4 vmathSoaV4MakeFrom4Aos_V( VmathVector4 vec0, VmathVector4 vec1, VmathVector4 vec2, VmathVector4 vec3 )
{
    VmathSoaVector4 result;
    vmathSoaV4MakeFrom4Aos(&result, &vec0, &vec1, &vec2, &vec3);
    return result;
}

static inline VmathSoaVector4 vmathSoaV4MakeXAxis_V( )
{
    VmathSoaVector4 result;
    vmathSoaV4MakeXAxis(&result);
    return result;
}

static inline VmathSoaVector4 vmathSoaV4MakeYAxis_V( )
{
    VmathSoaVector4 result;
    vmathSoaV4MakeYAxis(&result);
    return result;
}

static inline VmathSoaVector4 vmathSoaV4MakeZAxis_V( )
{
    VmathSoaVector4 result;
    vmathSoaV4MakeZAxis(&result);
    return result;
}

static inline VmathSoaVector4 vmathSoaV4MakeWAxis_V( )
{
    VmathSoaVector4 result;
    vmathSoaV4MakeWAxis(&result);
    return result;
}

static inline VmathSoaVector4 vmathSoaV4Lerp_V( vec_float4 t, VmathSoaVector4 vec0, VmathSoaVector4 vec1 )
{
    VmathSoaVector4 result;
    vmathSoaV4Lerp(&result, t, &vec0, &vec1);
    return result;
}

static inline VmathSoaVector4 vmathSoaV4Slerp_V( vec_float4 t, VmathSoaVector4 unitVec0, VmathSoaVector4 unitVec1 )
{
    VmathSoaVector4 result;
    vmathSoaV4Slerp(&result, t, &unitVec0, &unitVec1);
    return result;
}

static inline void vmathSoaV4Get4Aos_V( VmathSoaVector4 vec, VmathVector4 *result0, VmathVector4 *result1, VmathVector4 *result2, VmathVector4 *result3 )
{
    vmathSoaV4Get4Aos(&vec, result0, result1, result2, result3);
}

static inline void vmathSoaV4StoreHalfFloats_V( VmathSoaVector4 vec, vec_ushort8 *twoQuads )
{
    vmathSoaV4StoreHalfFloats(&vec, twoQuads);
}

static inline void vmathSoaV4SetXYZ_V( VmathSoaVector4 *result, VmathSoaVector3 vec )
{
    vmathSoaV4SetXYZ(result, &vec);
}

static inline VmathSoaVector3 vmathSoaV4GetXYZ_V( VmathSoaVector4 vec )
{
    VmathSoaVector3 result;
    vmathSoaV4GetXYZ(&result, &vec);
    return result;
}

static inline void vmathSoaV4SetX_V( VmathSoaVector4 *result, vec_float4 _x )
{
    vmathSoaV4SetX(result, _x);
}

static inline vec_float4 vmathSoaV4GetX_V( VmathSoaVector4 vec )
{
    return vmathSoaV4GetX(&vec);
}

static inline void vmathSoaV4SetY_V( VmathSoaVector4 *result, vec_float4 _y )
{
    vmathSoaV4SetY(result, _y);
}

static inline vec_float4 vmathSoaV4GetY_V( VmathSoaVector4 vec )
{
    return vmathSoaV4GetY(&vec);
}

static inline void vmathSoaV4SetZ_V( VmathSoaVector4 *result, vec_float4 _z )
{
    vmathSoaV4SetZ(result, _z);
}

static inline vec_float4 vmathSoaV4GetZ_V( VmathSoaVector4 vec )
{
    return vmathSoaV4GetZ(&vec);
}

static inline void vmathSoaV4SetW_V( VmathSoaVector4 *result, vec_float4 _w )
{
    vmathSoaV4SetW(result, _w);
}

static inline vec_float4 vmathSoaV4GetW_V( VmathSoaVector4 vec )
{
    return vmathSoaV4GetW(&vec);
}

static inline void vmathSoaV4SetElem_V( VmathSoaVector4 *result, int idx, vec_float4 value )
{
    vmathSoaV4SetElem(result, idx, value);
}

static inline vec_float4 vmathSoaV4GetElem_V( VmathSoaVector4 vec, int idx )
{
    return vmathSoaV4GetElem(&vec, idx);
}

static inline VmathSoaVector4 vmathSoaV4Add_V( VmathSoaVector4 vec0, VmathSoaVector4 vec1 )
{
    VmathSoaVector4 result;
    vmathSoaV4Add(&result, &vec0, &vec1);
    return result;
}

static inline VmathSoaVector4 vmathSoaV4Sub_V( VmathSoaVector4 vec0, VmathSoaVector4 vec1 )
{
    VmathSoaVector4 result;
    vmathSoaV4Sub(&result, &vec0, &vec1);
    return result;
}

static inline VmathSoaVector4 vmathSoaV4ScalarMul_V( VmathSoaVector4 vec, vec_float4 scalar )
{
    VmathSoaVector4 result;
    vmathSoaV4ScalarMul(&result, &vec, scalar);
    return result;
}

static inline VmathSoaVector4 vmathSoaV4ScalarDiv_V( VmathSoaVector4 vec, vec_float4 scalar )
{
    VmathSoaVector4 result;
    vmathSoaV4ScalarDiv(&result, &vec, scalar);
    return result;
}

static inline VmathSoaVector4 vmathSoaV4Neg_V( VmathSoaVector4 vec )
{
    VmathSoaVector4 result;
    vmathSoaV4Neg(&result, &vec);
    return result;
}

static inline VmathSoaVector4 vmathSoaV4MulPerElem_V( VmathSoaVector4 vec0, VmathSoaVector4 vec1 )
{
    VmathSoaVector4 result;
    vmathSoaV4MulPerElem(&result, &vec0, &vec1);
    return result;
}

static inline VmathSoaVector4 vmathSoaV4DivPerElem_V( VmathSoaVector4 vec0, VmathSoaVector4 vec1 )
{
    VmathSoaVector4 result;
    vmathSoaV4DivPerElem(&result, &vec0, &vec1);
    return result;
}

static inline VmathSoaVector4 vmathSoaV4RecipPerElem_V( VmathSoaVector4 vec )
{
    VmathSoaVector4 result;
    vmathSoaV4RecipPerElem(&result, &vec);
    return result;
}

static inline VmathSoaVector4 vmathSoaV4SqrtPerElem_V( VmathSoaVector4 vec )
{
    VmathSoaVector4 result;
    vmathSoaV4SqrtPerElem(&result, &vec);
    return result;
}

static inline VmathSoaVector4 vmathSoaV4RsqrtPerElem_V( VmathSoaVector4 vec )
{
    VmathSoaVector4 result;
    vmathSoaV4RsqrtPerElem(&result, &vec);
    return result;
}

static inline VmathSoaVector4 vmathSoaV4AbsPerElem_V( VmathSoaVector4 vec )
{
    VmathSoaVector4 result;
    vmathSoaV4AbsPerElem(&result, &vec);
    return result;
}

static inline VmathSoaVector4 vmathSoaV4CopySignPerElem_V( VmathSoaVector4 vec0, VmathSoaVector4 vec1 )
{
    VmathSoaVector4 result;
    vmathSoaV4CopySignPerElem(&result, &vec0, &vec1);
    return result;
}

static inline VmathSoaVector4 vmathSoaV4MaxPerElem_V( VmathSoaVector4 vec0, VmathSoaVector4 vec1 )
{
    VmathSoaVector4 result;
    vmathSoaV4MaxPerElem(&result, &vec0, &vec1);
    return result;
}

static inline vec_float4 vmathSoaV4MaxElem_V( VmathSoaVector4 vec )
{
    return vmathSoaV4MaxElem(&vec);
}

static inline VmathSoaVector4 vmathSoaV4MinPerElem_V( VmathSoaVector4 vec0, VmathSoaVector4 vec1 )
{
    VmathSoaVector4 result;
    vmathSoaV4MinPerElem(&result, &vec0, &vec1);
    return result;
}

static inline vec_float4 vmathSoaV4MinElem_V( VmathSoaVector4 vec )
{
    return vmathSoaV4MinElem(&vec);
}

static inline vec_float4 vmathSoaV4Sum_V( VmathSoaVector4 vec )
{
    return vmathSoaV4Sum(&vec);
}

static inline vec_float4 vmathSoaV4Dot_V( VmathSoaVector4 vec0, VmathSoaVector4 vec1 )
{
    return vmathSoaV4Dot(&vec0, &vec1);
}

static inline vec_float4 vmathSoaV4LengthSqr_V( VmathSoaVector4 vec )
{
    return vmathSoaV4LengthSqr(&vec);
}

static inline vec_float4 vmathSoaV4Length_V( VmathSoaVector4 vec )
{
    return vmathSoaV4Length(&vec);
}

static inline VmathSoaVector4 vmathSoaV4Normalize_V( VmathSoaVector4 vec )
{
    VmathSoaVector4 result;
    vmathSoaV4Normalize(&result, &vec);
    return result;
}

static inline VmathSoaVector4 vmathSoaV4Select_V( VmathSoaVector4 vec0, VmathSoaVector4 vec1, vec_uint4 select1 )
{
    VmathSoaVector4 result;
    vmathSoaV4Select(&result, &vec0, &vec1, select1);
    return result;
}

#ifdef _VECTORMATH_DEBUG

static inline void vmathSoaV4Print_V( VmathSoaVector4 vec )
{
    vmathSoaV4Print(&vec);
}

static inline void vmathSoaV4Prints_V( VmathSoaVector4 vec, const char *name )
{
    vmathSoaV4Prints(&vec, name);
}

#endif

static inline VmathSoaPoint3 vmathSoaP3MakeFromElems_V( vec_float4 _x, vec_float4 _y, vec_float4 _z )
{
    VmathSoaPoint3 result;
    vmathSoaP3MakeFromElems(&result, _x, _y, _z);
    return result;
}

static inline VmathSoaPoint3 vmathSoaP3MakeFromV3_V( VmathSoaVector3 vec )
{
    VmathSoaPoint3 result;
    vmathSoaP3MakeFromV3(&result, &vec);
    return result;
}

static inline VmathSoaPoint3 vmathSoaP3MakeFromScalar_V( vec_float4 scalar )
{
    VmathSoaPoint3 result;
    vmathSoaP3MakeFromScalar(&result, scalar);
    return result;
}

static inline VmathSoaPoint3 vmathSoaP3MakeFromAos_V( VmathPoint3 pnt )
{
    VmathSoaPoint3 result;
    vmathSoaP3MakeFromAos(&result, &pnt);
    return result;
}

static inline VmathSoaPoint3 vmathSoaP3MakeFrom4Aos_V( VmathPoint3 pnt0, VmathPoint3 pnt1, VmathPoint3 pnt2, VmathPoint3 pnt3 )
{
    VmathSoaPoint3 result;
    vmathSoaP3MakeFrom4Aos(&result, &pnt0, &pnt1, &pnt2, &pnt3);
    return result;
}

static inline VmathSoaPoint3 vmathSoaP3Lerp_V( vec_float4 t, VmathSoaPoint3 pnt0, VmathSoaPoint3 pnt1 )
{
    VmathSoaPoint3 result;
    vmathSoaP3Lerp(&result, t, &pnt0, &pnt1);
    return result;
}

static inline void vmathSoaP3Get4Aos_V( VmathSoaPoint3 pnt, VmathPoint3 *result0, VmathPoint3 *result1, VmathPoint3 *result2, VmathPoint3 *result3 )
{
    vmathSoaP3Get4Aos(&pnt, result0, result1, result2, result3);
}

static inline void vmathSoaP3LoadXYZArray_V( VmathSoaPoint3 *vec, const vec_float4 *threeQuads )
{
    vmathSoaP3LoadXYZArray(vec, threeQuads);
}

static inline void vmathSoaP3StoreXYZArray_V( VmathSoaPoint3 vec, vec_float4 *threeQuads )
{
    vmathSoaP3StoreXYZArray(&vec, threeQuads);
}

static inline void vmathSoaP3StoreHalfFloats_V( VmathSoaPoint3 pnt0, VmathSoaPoint3 pnt1, vec_ushort8 *threeQuads )
{
    vmathSoaP3StoreHalfFloats(&pnt0, &pnt1, threeQuads);
}

static inline void vmathSoaP3SetX_V( VmathSoaPoint3 *result, vec_float4 _x )
{
    vmathSoaP3SetX(result, _x);
}

static inline vec_float4 vmathSoaP3GetX_V( VmathSoaPoint3 pnt )
{
    return vmathSoaP3GetX(&pnt);
}

static inline void vmathSoaP3SetY_V( VmathSoaPoint3 *result, vec_float4 _y )
{
    vmathSoaP3SetY(result, _y);
}

static inline vec_float4 vmathSoaP3GetY_V( VmathSoaPoint3 pnt )
{
    return vmathSoaP3GetY(&pnt);
}

static inline void vmathSoaP3SetZ_V( VmathSoaPoint3 *result, vec_float4 _z )
{
    vmathSoaP3SetZ(result, _z);
}

static inline vec_float4 vmathSoaP3GetZ_V( VmathSoaPoint3 pnt )
{
    return vmathSoaP3GetZ(&pnt);
}

static inline void vmathSoaP3SetElem_V( VmathSoaPoint3 *result, int idx, vec_float4 value )
{
    vmathSoaP3SetElem(result, idx, value);
}

static inline vec_float4 vmathSoaP3GetElem_V( VmathSoaPoint3 pnt, int idx )
{
    return vmathSoaP3GetElem(&pnt, idx);
}

static inline VmathSoaVector3 vmathSoaP3Sub_V( VmathSoaPoint3 pnt0, VmathSoaPoint3 pnt1 )
{
    VmathSoaVector3 result;
    vmathSoaP3Sub(&result, &pnt0, &pnt1);
    return result;
}

static inline VmathSoaPoint3 vmathSoaP3AddV3_V( VmathSoaPoint3 pnt, VmathSoaVector3 vec1 )
{
    VmathSoaPoint3 result;
    vmathSoaP3AddV3(&result, &pnt, &vec1);
    return result;
}

static inline VmathSoaPoint3 vmathSoaP3SubV3_V( VmathSoaPoint3 pnt, VmathSoaVector3 vec1 )
{
    VmathSoaPoint3 result;
    vmathSoaP3SubV3(&result, &pnt, &vec1);
    return result;
}

static inline VmathSoaPoint3 vmathSoaP3MulPerElem_V( VmathSoaPoint3 pnt0, VmathSoaPoint3 pnt1 )
{
    VmathSoaPoint3 result;
    vmathSoaP3MulPerElem(&result, &pnt0, &pnt1);
    return result;
}

static inline VmathSoaPoint3 vmathSoaP3DivPerElem_V( VmathSoaPoint3 pnt0, VmathSoaPoint3 pnt1 )
{
    VmathSoaPoint3 result;
    vmathSoaP3DivPerElem(&result, &pnt0, &pnt1);
    return result;
}

static inline VmathSoaPoint3 vmathSoaP3RecipPerElem_V( VmathSoaPoint3 pnt )
{
    VmathSoaPoint3 result;
    vmathSoaP3RecipPerElem(&result, &pnt);
    return result;
}

static inline VmathSoaPoint3 vmathSoaP3SqrtPerElem_V( VmathSoaPoint3 pnt )
{
    VmathSoaPoint3 result;
    vmathSoaP3SqrtPerElem(&result, &pnt);
    return result;
}

static inline VmathSoaPoint3 vmathSoaP3RsqrtPerElem_V( VmathSoaPoint3 pnt )
{
    VmathSoaPoint3 result;
    vmathSoaP3RsqrtPerElem(&result, &pnt);
    return result;
}

static inline VmathSoaPoint3 vmathSoaP3AbsPerElem_V( VmathSoaPoint3 pnt )
{
    VmathSoaPoint3 result;
    vmathSoaP3AbsPerElem(&result, &pnt);
    return result;
}

static inline VmathSoaPoint3 vmathSoaP3CopySignPerElem_V( VmathSoaPoint3 pnt0, VmathSoaPoint3 pnt1 )
{
    VmathSoaPoint3 result;
    vmathSoaP3CopySignPerElem(&result, &pnt0, &pnt1);
    return result;
}

static inline VmathSoaPoint3 vmathSoaP3MaxPerElem_V( VmathSoaPoint3 pnt0, VmathSoaPoint3 pnt1 )
{
    VmathSoaPoint3 result;
    vmathSoaP3MaxPerElem(&result, &pnt0, &pnt1);
    return result;
}

static inline vec_float4 vmathSoaP3MaxElem_V( VmathSoaPoint3 pnt )
{
    return vmathSoaP3MaxElem(&pnt);
}

static inline VmathSoaPoint3 vmathSoaP3MinPerElem_V( VmathSoaPoint3 pnt0, VmathSoaPoint3 pnt1 )
{
    VmathSoaPoint3 result;
    vmathSoaP3MinPerElem(&result, &pnt0, &pnt1);
    return result;
}

static inline vec_float4 vmathSoaP3MinElem_V( VmathSoaPoint3 pnt )
{
    return vmathSoaP3MinElem(&pnt);
}

static inline vec_float4 vmathSoaP3Sum_V( VmathSoaPoint3 pnt )
{
    return vmathSoaP3Sum(&pnt);
}

static inline VmathSoaPoint3 vmathSoaP3Scale_V( VmathSoaPoint3 pnt, vec_float4 scaleVal )
{
    VmathSoaPoint3 result;
    vmathSoaP3Scale(&result, &pnt, scaleVal);
    return result;
}

static inline VmathSoaPoint3 vmathSoaP3NonUniformScale_V( VmathSoaPoint3 pnt, VmathSoaVector3 scaleVec )
{
    VmathSoaPoint3 result;
    vmathSoaP3NonUniformScale(&result, &pnt, &scaleVec);
    return result;
}

static inline vec_float4 vmathSoaP3Projection_V( VmathSoaPoint3 pnt, VmathSoaVector3 unitVec )
{
    return vmathSoaP3Projection(&pnt, &unitVec);
}

static inline vec_float4 vmathSoaP3DistSqrFromOrigin_V( VmathSoaPoint3 pnt )
{
    return vmathSoaP3DistSqrFromOrigin(&pnt);
}

static inline vec_float4 vmathSoaP3DistFromOrigin_V( VmathSoaPoint3 pnt )
{
    return vmathSoaP3DistFromOrigin(&pnt);
}

static inline vec_float4 vmathSoaP3DistSqr_V( VmathSoaPoint3 pnt0, VmathSoaPoint3 pnt1 )
{
    return vmathSoaP3DistSqr(&pnt0, &pnt1);
}

static inline vec_float4 vmathSoaP3Dist_V( VmathSoaPoint3 pnt0, VmathSoaPoint3 pnt1 )
{
    return vmathSoaP3Dist(&pnt0, &pnt1);
}

static inline VmathSoaPoint3 vmathSoaP3Select_V( VmathSoaPoint3 pnt0, VmathSoaPoint3 pnt1, vec_uint4 select1 )
{
    VmathSoaPoint3 result;
    vmathSoaP3Select(&result, &pnt0, &pnt1, select1);
    return result;
}

#ifdef _VECTORMATH_DEBUG

static inline void vmathSoaP3Print_V( VmathSoaPoint3 pnt )
{
    vmathSoaP3Print(&pnt);
}

static inline void vmathSoaP3Prints_V( VmathSoaPoint3 pnt, const char *name )
{
    vmathSoaP3Prints(&pnt, name);
}

#endif

#ifdef __cplusplus
}
#endif /* __cplusplus */

#endif

Commits for Divide-Dependencies/debug-draw/samples/vectormath/spu/c/vec_soa_v.h

Diff revisions: vs.
Revision Author Commited Message
70 IonutCava picture IonutCava Wed 26 Jul, 2017 20:21:42 +0000

[Ionut]
- Added Hodgman’s variant of the debug-draw library. ref: https://github.com/hodgman/debug-draw