Tizen 2.1 base
[platform/upstream/libbullet.git] / Extras / vectormathlibrary / include / vectormath / ppu / c / quat_soa_v.h
1 /*
2    Copyright (C) 2006, 2007 Sony Computer Entertainment Inc.
3    All rights reserved.
4
5    Redistribution and use in source and binary forms,
6    with or without modification, are permitted provided that the
7    following conditions are met:
8     * Redistributions of source code must retain the above copyright
9       notice, this list of conditions and the following disclaimer.
10     * Redistributions in binary form must reproduce the above copyright
11       notice, this list of conditions and the following disclaimer in the
12       documentation and/or other materials provided with the distribution.
13     * Neither the name of the Sony Computer Entertainment Inc nor the names
14       of its contributors may be used to endorse or promote products derived
15       from this software without specific prior written permission.
16
17    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18    AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19    IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20    ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
21    LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22    CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23    SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24    INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25    CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26    ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27    POSSIBILITY OF SUCH DAMAGE.
28 */
29
30 #ifndef _VECTORMATH_QUAT_SOA_V_C_H
31 #define _VECTORMATH_QUAT_SOA_V_C_H
32 #ifdef __cplusplus
33 extern "C" {
34 #endif /* __cplusplus */
35
36 /*-----------------------------------------------------------------------------
37  * Definitions
38  */
39 #ifndef _VECTORMATH_INTERNAL_FUNCTIONS
40 #define _VECTORMATH_INTERNAL_FUNCTIONS
41
42 #endif
43
44 static inline VmathSoaQuat vmathSoaQMakeFromElems_V( vec_float4 _x, vec_float4 _y, vec_float4 _z, vec_float4 _w )
45 {
46     VmathSoaQuat result;
47     vmathSoaQMakeFromElems(&result, _x, _y, _z, _w);
48     return result;
49 }
50
51 static inline VmathSoaQuat vmathSoaQMakeFromV3Scalar_V( VmathSoaVector3 xyz, vec_float4 _w )
52 {
53     VmathSoaQuat result;
54     vmathSoaQMakeFromV3Scalar(&result, &xyz, _w);
55     return result;
56 }
57
58 static inline VmathSoaQuat vmathSoaQMakeFromV4_V( VmathSoaVector4 vec )
59 {
60     VmathSoaQuat result;
61     vmathSoaQMakeFromV4(&result, &vec);
62     return result;
63 }
64
65 static inline VmathSoaQuat vmathSoaQMakeFromScalar_V( vec_float4 scalar )
66 {
67     VmathSoaQuat result;
68     vmathSoaQMakeFromScalar(&result, scalar);
69     return result;
70 }
71
72 static inline VmathSoaQuat vmathSoaQMakeFromAos_V( VmathQuat quat )
73 {
74     VmathSoaQuat result;
75     vmathSoaQMakeFromAos(&result, &quat);
76     return result;
77 }
78
79 static inline VmathSoaQuat vmathSoaQMakeFrom4Aos_V( VmathQuat quat0, VmathQuat quat1, VmathQuat quat2, VmathQuat quat3 )
80 {
81     VmathSoaQuat result;
82     vmathSoaQMakeFrom4Aos(&result, &quat0, &quat1, &quat2, &quat3);
83     return result;
84 }
85
86 static inline VmathSoaQuat vmathSoaQMakeIdentity_V( )
87 {
88     VmathSoaQuat result;
89     vmathSoaQMakeIdentity(&result);
90     return result;
91 }
92
93 static inline VmathSoaQuat vmathSoaQLerp_V( vec_float4 t, VmathSoaQuat quat0, VmathSoaQuat quat1 )
94 {
95     VmathSoaQuat result;
96     vmathSoaQLerp(&result, t, &quat0, &quat1);
97     return result;
98 }
99
100 static inline VmathSoaQuat vmathSoaQSlerp_V( vec_float4 t, VmathSoaQuat unitQuat0, VmathSoaQuat unitQuat1 )
101 {
102     VmathSoaQuat result;
103     vmathSoaQSlerp(&result, t, &unitQuat0, &unitQuat1);
104     return result;
105 }
106
107 static inline VmathSoaQuat vmathSoaQSquad_V( vec_float4 t, VmathSoaQuat unitQuat0, VmathSoaQuat unitQuat1, VmathSoaQuat unitQuat2, VmathSoaQuat unitQuat3 )
108 {
109     VmathSoaQuat result;
110     vmathSoaQSquad(&result, t, &unitQuat0, &unitQuat1, &unitQuat2, &unitQuat3);
111     return result;
112 }
113
114 static inline void vmathSoaQGet4Aos_V( VmathSoaQuat quat, VmathQuat *result0, VmathQuat *result1, VmathQuat *result2, VmathQuat *result3 )
115 {
116     vmathSoaQGet4Aos(&quat, result0, result1, result2, result3);
117 }
118
119 static inline void vmathSoaQSetXYZ_V( VmathSoaQuat *result, VmathSoaVector3 vec )
120 {
121     vmathSoaQSetXYZ(result, &vec);
122 }
123
124 static inline VmathSoaVector3 vmathSoaQGetXYZ_V( VmathSoaQuat quat )
125 {
126     VmathSoaVector3 result;
127     vmathSoaQGetXYZ(&result, &quat);
128     return result;
129 }
130
131 static inline void vmathSoaQSetX_V( VmathSoaQuat *result, vec_float4 _x )
132 {
133     vmathSoaQSetX(result, _x);
134 }
135
136 static inline vec_float4 vmathSoaQGetX_V( VmathSoaQuat quat )
137 {
138     return vmathSoaQGetX(&quat);
139 }
140
141 static inline void vmathSoaQSetY_V( VmathSoaQuat *result, vec_float4 _y )
142 {
143     vmathSoaQSetY(result, _y);
144 }
145
146 static inline vec_float4 vmathSoaQGetY_V( VmathSoaQuat quat )
147 {
148     return vmathSoaQGetY(&quat);
149 }
150
151 static inline void vmathSoaQSetZ_V( VmathSoaQuat *result, vec_float4 _z )
152 {
153     vmathSoaQSetZ(result, _z);
154 }
155
156 static inline vec_float4 vmathSoaQGetZ_V( VmathSoaQuat quat )
157 {
158     return vmathSoaQGetZ(&quat);
159 }
160
161 static inline void vmathSoaQSetW_V( VmathSoaQuat *result, vec_float4 _w )
162 {
163     vmathSoaQSetW(result, _w);
164 }
165
166 static inline vec_float4 vmathSoaQGetW_V( VmathSoaQuat quat )
167 {
168     return vmathSoaQGetW(&quat);
169 }
170
171 static inline void vmathSoaQSetElem_V( VmathSoaQuat *result, int idx, vec_float4 value )
172 {
173     vmathSoaQSetElem(result, idx, value);
174 }
175
176 static inline vec_float4 vmathSoaQGetElem_V( VmathSoaQuat quat, int idx )
177 {
178     return vmathSoaQGetElem(&quat, idx);
179 }
180
181 static inline VmathSoaQuat vmathSoaQAdd_V( VmathSoaQuat quat0, VmathSoaQuat quat1 )
182 {
183     VmathSoaQuat result;
184     vmathSoaQAdd(&result, &quat0, &quat1);
185     return result;
186 }
187
188 static inline VmathSoaQuat vmathSoaQSub_V( VmathSoaQuat quat0, VmathSoaQuat quat1 )
189 {
190     VmathSoaQuat result;
191     vmathSoaQSub(&result, &quat0, &quat1);
192     return result;
193 }
194
195 static inline VmathSoaQuat vmathSoaQScalarMul_V( VmathSoaQuat quat, vec_float4 scalar )
196 {
197     VmathSoaQuat result;
198     vmathSoaQScalarMul(&result, &quat, scalar);
199     return result;
200 }
201
202 static inline VmathSoaQuat vmathSoaQScalarDiv_V( VmathSoaQuat quat, vec_float4 scalar )
203 {
204     VmathSoaQuat result;
205     vmathSoaQScalarDiv(&result, &quat, scalar);
206     return result;
207 }
208
209 static inline VmathSoaQuat vmathSoaQNeg_V( VmathSoaQuat quat )
210 {
211     VmathSoaQuat result;
212     vmathSoaQNeg(&result, &quat);
213     return result;
214 }
215
216 static inline vec_float4 vmathSoaQDot_V( VmathSoaQuat quat0, VmathSoaQuat quat1 )
217 {
218     return vmathSoaQDot(&quat0, &quat1);
219 }
220
221 static inline vec_float4 vmathSoaQNorm_V( VmathSoaQuat quat )
222 {
223     return vmathSoaQNorm(&quat);
224 }
225
226 static inline vec_float4 vmathSoaQLength_V( VmathSoaQuat quat )
227 {
228     return vmathSoaQLength(&quat);
229 }
230
231 static inline VmathSoaQuat vmathSoaQNormalize_V( VmathSoaQuat quat )
232 {
233     VmathSoaQuat result;
234     vmathSoaQNormalize(&result, &quat);
235     return result;
236 }
237
238 static inline VmathSoaQuat vmathSoaQMakeRotationArc_V( VmathSoaVector3 unitVec0, VmathSoaVector3 unitVec1 )
239 {
240     VmathSoaQuat result;
241     vmathSoaQMakeRotationArc(&result, &unitVec0, &unitVec1);
242     return result;
243 }
244
245 static inline VmathSoaQuat vmathSoaQMakeRotationAxis_V( vec_float4 radians, VmathSoaVector3 unitVec )
246 {
247     VmathSoaQuat result;
248     vmathSoaQMakeRotationAxis(&result, radians, &unitVec);
249     return result;
250 }
251
252 static inline VmathSoaQuat vmathSoaQMakeRotationX_V( vec_float4 radians )
253 {
254     VmathSoaQuat result;
255     vmathSoaQMakeRotationX(&result, radians);
256     return result;
257 }
258
259 static inline VmathSoaQuat vmathSoaQMakeRotationY_V( vec_float4 radians )
260 {
261     VmathSoaQuat result;
262     vmathSoaQMakeRotationY(&result, radians);
263     return result;
264 }
265
266 static inline VmathSoaQuat vmathSoaQMakeRotationZ_V( vec_float4 radians )
267 {
268     VmathSoaQuat result;
269     vmathSoaQMakeRotationZ(&result, radians);
270     return result;
271 }
272
273 static inline VmathSoaQuat vmathSoaQMul_V( VmathSoaQuat quat0, VmathSoaQuat quat1 )
274 {
275     VmathSoaQuat result;
276     vmathSoaQMul(&result, &quat0, &quat1);
277     return result;
278 }
279
280 static inline VmathSoaVector3 vmathSoaQRotate_V( VmathSoaQuat quat, VmathSoaVector3 vec )
281 {
282     VmathSoaVector3 result;
283     vmathSoaQRotate(&result, &quat, &vec);
284     return result;
285 }
286
287 static inline VmathSoaQuat vmathSoaQConj_V( VmathSoaQuat quat )
288 {
289     VmathSoaQuat result;
290     vmathSoaQConj(&result, &quat);
291     return result;
292 }
293
294 static inline VmathSoaQuat vmathSoaQSelect_V( VmathSoaQuat quat0, VmathSoaQuat quat1, vec_uint4 select1 )
295 {
296     VmathSoaQuat result;
297     vmathSoaQSelect(&result, &quat0, &quat1, select1);
298     return result;
299 }
300
301 #ifdef _VECTORMATH_DEBUG
302
303 static inline void vmathSoaQPrint_V( VmathSoaQuat quat )
304 {
305     vmathSoaQPrint(&quat);
306 }
307
308 static inline void vmathSoaQPrints_V( VmathSoaQuat quat, const char *name )
309 {
310     vmathSoaQPrints(&quat, name);
311 }
312
313 #endif
314
315 #ifdef __cplusplus
316 }
317 #endif /* __cplusplus */
318
319 #endif