2 Copyright (C) 2006, 2007 Sony Computer Entertainment Inc.
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.
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.
30 #ifndef _VECTORMATH_QUAT_SOA_V_C_H
31 #define _VECTORMATH_QUAT_SOA_V_C_H
34 #endif /* __cplusplus */
36 /*-----------------------------------------------------------------------------
39 #ifndef _VECTORMATH_INTERNAL_FUNCTIONS
40 #define _VECTORMATH_INTERNAL_FUNCTIONS
44 static inline VmathSoaQuat vmathSoaQMakeFromElems_V( vec_float4 _x, vec_float4 _y, vec_float4 _z, vec_float4 _w )
47 vmathSoaQMakeFromElems(&result, _x, _y, _z, _w);
51 static inline VmathSoaQuat vmathSoaQMakeFromV3Scalar_V( VmathSoaVector3 xyz, vec_float4 _w )
54 vmathSoaQMakeFromV3Scalar(&result, &xyz, _w);
58 static inline VmathSoaQuat vmathSoaQMakeFromV4_V( VmathSoaVector4 vec )
61 vmathSoaQMakeFromV4(&result, &vec);
65 static inline VmathSoaQuat vmathSoaQMakeFromScalar_V( vec_float4 scalar )
68 vmathSoaQMakeFromScalar(&result, scalar);
72 static inline VmathSoaQuat vmathSoaQMakeFromAos_V( VmathQuat quat )
75 vmathSoaQMakeFromAos(&result, &quat);
79 static inline VmathSoaQuat vmathSoaQMakeFrom4Aos_V( VmathQuat quat0, VmathQuat quat1, VmathQuat quat2, VmathQuat quat3 )
82 vmathSoaQMakeFrom4Aos(&result, &quat0, &quat1, &quat2, &quat3);
86 static inline VmathSoaQuat vmathSoaQMakeIdentity_V( )
89 vmathSoaQMakeIdentity(&result);
93 static inline VmathSoaQuat vmathSoaQLerp_V( vec_float4 t, VmathSoaQuat quat0, VmathSoaQuat quat1 )
96 vmathSoaQLerp(&result, t, &quat0, &quat1);
100 static inline VmathSoaQuat vmathSoaQSlerp_V( vec_float4 t, VmathSoaQuat unitQuat0, VmathSoaQuat unitQuat1 )
103 vmathSoaQSlerp(&result, t, &unitQuat0, &unitQuat1);
107 static inline VmathSoaQuat vmathSoaQSquad_V( vec_float4 t, VmathSoaQuat unitQuat0, VmathSoaQuat unitQuat1, VmathSoaQuat unitQuat2, VmathSoaQuat unitQuat3 )
110 vmathSoaQSquad(&result, t, &unitQuat0, &unitQuat1, &unitQuat2, &unitQuat3);
114 static inline void vmathSoaQGet4Aos_V( VmathSoaQuat quat, VmathQuat *result0, VmathQuat *result1, VmathQuat *result2, VmathQuat *result3 )
116 vmathSoaQGet4Aos(&quat, result0, result1, result2, result3);
119 static inline void vmathSoaQSetXYZ_V( VmathSoaQuat *result, VmathSoaVector3 vec )
121 vmathSoaQSetXYZ(result, &vec);
124 static inline VmathSoaVector3 vmathSoaQGetXYZ_V( VmathSoaQuat quat )
126 VmathSoaVector3 result;
127 vmathSoaQGetXYZ(&result, &quat);
131 static inline void vmathSoaQSetX_V( VmathSoaQuat *result, vec_float4 _x )
133 vmathSoaQSetX(result, _x);
136 static inline vec_float4 vmathSoaQGetX_V( VmathSoaQuat quat )
138 return vmathSoaQGetX(&quat);
141 static inline void vmathSoaQSetY_V( VmathSoaQuat *result, vec_float4 _y )
143 vmathSoaQSetY(result, _y);
146 static inline vec_float4 vmathSoaQGetY_V( VmathSoaQuat quat )
148 return vmathSoaQGetY(&quat);
151 static inline void vmathSoaQSetZ_V( VmathSoaQuat *result, vec_float4 _z )
153 vmathSoaQSetZ(result, _z);
156 static inline vec_float4 vmathSoaQGetZ_V( VmathSoaQuat quat )
158 return vmathSoaQGetZ(&quat);
161 static inline void vmathSoaQSetW_V( VmathSoaQuat *result, vec_float4 _w )
163 vmathSoaQSetW(result, _w);
166 static inline vec_float4 vmathSoaQGetW_V( VmathSoaQuat quat )
168 return vmathSoaQGetW(&quat);
171 static inline void vmathSoaQSetElem_V( VmathSoaQuat *result, int idx, vec_float4 value )
173 vmathSoaQSetElem(result, idx, value);
176 static inline vec_float4 vmathSoaQGetElem_V( VmathSoaQuat quat, int idx )
178 return vmathSoaQGetElem(&quat, idx);
181 static inline VmathSoaQuat vmathSoaQAdd_V( VmathSoaQuat quat0, VmathSoaQuat quat1 )
184 vmathSoaQAdd(&result, &quat0, &quat1);
188 static inline VmathSoaQuat vmathSoaQSub_V( VmathSoaQuat quat0, VmathSoaQuat quat1 )
191 vmathSoaQSub(&result, &quat0, &quat1);
195 static inline VmathSoaQuat vmathSoaQScalarMul_V( VmathSoaQuat quat, vec_float4 scalar )
198 vmathSoaQScalarMul(&result, &quat, scalar);
202 static inline VmathSoaQuat vmathSoaQScalarDiv_V( VmathSoaQuat quat, vec_float4 scalar )
205 vmathSoaQScalarDiv(&result, &quat, scalar);
209 static inline VmathSoaQuat vmathSoaQNeg_V( VmathSoaQuat quat )
212 vmathSoaQNeg(&result, &quat);
216 static inline vec_float4 vmathSoaQDot_V( VmathSoaQuat quat0, VmathSoaQuat quat1 )
218 return vmathSoaQDot(&quat0, &quat1);
221 static inline vec_float4 vmathSoaQNorm_V( VmathSoaQuat quat )
223 return vmathSoaQNorm(&quat);
226 static inline vec_float4 vmathSoaQLength_V( VmathSoaQuat quat )
228 return vmathSoaQLength(&quat);
231 static inline VmathSoaQuat vmathSoaQNormalize_V( VmathSoaQuat quat )
234 vmathSoaQNormalize(&result, &quat);
238 static inline VmathSoaQuat vmathSoaQMakeRotationArc_V( VmathSoaVector3 unitVec0, VmathSoaVector3 unitVec1 )
241 vmathSoaQMakeRotationArc(&result, &unitVec0, &unitVec1);
245 static inline VmathSoaQuat vmathSoaQMakeRotationAxis_V( vec_float4 radians, VmathSoaVector3 unitVec )
248 vmathSoaQMakeRotationAxis(&result, radians, &unitVec);
252 static inline VmathSoaQuat vmathSoaQMakeRotationX_V( vec_float4 radians )
255 vmathSoaQMakeRotationX(&result, radians);
259 static inline VmathSoaQuat vmathSoaQMakeRotationY_V( vec_float4 radians )
262 vmathSoaQMakeRotationY(&result, radians);
266 static inline VmathSoaQuat vmathSoaQMakeRotationZ_V( vec_float4 radians )
269 vmathSoaQMakeRotationZ(&result, radians);
273 static inline VmathSoaQuat vmathSoaQMul_V( VmathSoaQuat quat0, VmathSoaQuat quat1 )
276 vmathSoaQMul(&result, &quat0, &quat1);
280 static inline VmathSoaVector3 vmathSoaQRotate_V( VmathSoaQuat quat, VmathSoaVector3 vec )
282 VmathSoaVector3 result;
283 vmathSoaQRotate(&result, &quat, &vec);
287 static inline VmathSoaQuat vmathSoaQConj_V( VmathSoaQuat quat )
290 vmathSoaQConj(&result, &quat);
294 static inline VmathSoaQuat vmathSoaQSelect_V( VmathSoaQuat quat0, VmathSoaQuat quat1, vec_uint4 select1 )
297 vmathSoaQSelect(&result, &quat0, &quat1, select1);
301 #ifdef _VECTORMATH_DEBUG
303 static inline void vmathSoaQPrint_V( VmathSoaQuat quat )
305 vmathSoaQPrint(&quat);
308 static inline void vmathSoaQPrints_V( VmathSoaQuat quat, const char *name )
310 vmathSoaQPrints(&quat, name);
317 #endif /* __cplusplus */