Bullet Collision Detection & Physics Library
sse/quat_aos.h
Go to the documentation of this file.
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 
31 #ifndef _VECTORMATH_QUAT_AOS_CPP_H
32 #define _VECTORMATH_QUAT_AOS_CPP_H
33 
34 //-----------------------------------------------------------------------------
35 // Definitions
36 
37 #ifndef _VECTORMATH_INTERNAL_FUNCTIONS
38 #define _VECTORMATH_INTERNAL_FUNCTIONS
39 
40 #endif
41 
42 namespace Vectormath {
43 namespace Aos {
44 
46 {
47  mVec128 = vec;
48 }
49 
50 VECTORMATH_FORCE_INLINE Quat::Quat( const floatInVec &_x, const floatInVec &_y, const floatInVec &_z, const floatInVec &_w )
51 {
52  mVec128 = _mm_unpacklo_ps(
53  _mm_unpacklo_ps( _x.get128(), _z.get128() ),
54  _mm_unpacklo_ps( _y.get128(), _w.get128() ) );
55 }
56 
57 VECTORMATH_FORCE_INLINE Quat::Quat( const Vector3 &xyz, float _w )
58 {
59  mVec128 = xyz.get128();
61 }
62 
63 
64 
65 VECTORMATH_FORCE_INLINE Quat::Quat(const Quat& quat)
66 {
67  mVec128 = quat.get128();
68 }
69 
70 VECTORMATH_FORCE_INLINE Quat::Quat( float _x, float _y, float _z, float _w )
71 {
72  mVec128 = _mm_setr_ps(_x, _y, _z, _w);
73 }
74 
75 
76 
77 
78 
80 {
81  mVec128 = xyz.get128();
83 }
84 
86 {
87  mVec128 = vec.get128();
88 }
89 
90 VECTORMATH_FORCE_INLINE Quat::Quat( float scalar )
91 {
92  mVec128 = floatInVec(scalar).get128();
93 }
94 
96 {
97  mVec128 = scalar.get128();
98 }
99 
101 {
102  mVec128 = vf4;
103 }
104 
106 {
107  return Quat( _VECTORMATH_UNIT_0001 );
108 }
109 
110 VECTORMATH_FORCE_INLINE const Quat lerp( float t, const Quat &quat0, const Quat &quat1 )
111 {
112  return lerp( floatInVec(t), quat0, quat1 );
113 }
114 
115 VECTORMATH_FORCE_INLINE const Quat lerp( const floatInVec &t, const Quat &quat0, const Quat &quat1 )
116 {
117  return ( quat0 + ( ( quat1 - quat0 ) * t ) );
118 }
119 
120 VECTORMATH_FORCE_INLINE const Quat slerp( float t, const Quat &unitQuat0, const Quat &unitQuat1 )
121 {
122  return slerp( floatInVec(t), unitQuat0, unitQuat1 );
123 }
124 
125 VECTORMATH_FORCE_INLINE const Quat slerp( const floatInVec &t, const Quat &unitQuat0, const Quat &unitQuat1 )
126 {
127  Quat start;
128  vec_float4 scales, scale0, scale1, cosAngle, angle, tttt, oneMinusT, angles, sines;
129  __m128 selectMask;
130  cosAngle = _vmathVfDot4( unitQuat0.get128(), unitQuat1.get128() );
131  selectMask = (__m128)vec_cmpgt( _mm_setzero_ps(), cosAngle );
132  cosAngle = vec_sel( cosAngle, negatef4( cosAngle ), selectMask );
133  start = Quat( vec_sel( unitQuat0.get128(), negatef4( unitQuat0.get128() ), selectMask ) );
134  selectMask = (__m128)vec_cmpgt( _mm_set1_ps(_VECTORMATH_SLERP_TOL), cosAngle );
135  angle = acosf4( cosAngle );
136  tttt = t.get128();
137  oneMinusT = vec_sub( _mm_set1_ps(1.0f), tttt );
138  angles = vec_mergeh( _mm_set1_ps(1.0f), tttt );
139  angles = vec_mergeh( angles, oneMinusT );
140  angles = vec_madd( angles, angle, _mm_setzero_ps() );
141  sines = sinf4( angles );
142  scales = _mm_div_ps( sines, vec_splat( sines, 0 ) );
143  scale0 = vec_sel( oneMinusT, vec_splat( scales, 1 ), selectMask );
144  scale1 = vec_sel( tttt, vec_splat( scales, 2 ), selectMask );
145  return Quat( vec_madd( start.get128(), scale0, vec_mul( unitQuat1.get128(), scale1 ) ) );
146 }
147 
148 VECTORMATH_FORCE_INLINE const Quat squad( float t, const Quat &unitQuat0, const Quat &unitQuat1, const Quat &unitQuat2, const Quat &unitQuat3 )
149 {
150  return squad( floatInVec(t), unitQuat0, unitQuat1, unitQuat2, unitQuat3 );
151 }
152 
153 VECTORMATH_FORCE_INLINE const Quat squad( const floatInVec &t, const Quat &unitQuat0, const Quat &unitQuat1, const Quat &unitQuat2, const Quat &unitQuat3 )
154 {
155  return slerp( ( ( floatInVec(2.0f) * t ) * ( floatInVec(1.0f) - t ) ), slerp( t, unitQuat0, unitQuat3 ), slerp( t, unitQuat1, unitQuat2 ) );
156 }
157 
159 {
160  return mVec128;
161 }
162 
164 {
165  mVec128 = quat.mVec128;
166  return *this;
167 }
168 
169 VECTORMATH_FORCE_INLINE Quat & Quat::setXYZ( const Vector3 &vec )
170 {
171  VM_ATTRIBUTE_ALIGN16 unsigned int sw[4] = {0, 0, 0, 0xffffffff};
172  mVec128 = vec_sel( vec.get128(), mVec128, sw );
173  return *this;
174 }
175 
176 VECTORMATH_FORCE_INLINE const Vector3 Quat::getXYZ( ) const
177 {
178  return Vector3( mVec128 );
179 }
180 
181 VECTORMATH_FORCE_INLINE Quat & Quat::setX( float _x )
182 {
183  _vmathVfSetElement(mVec128, _x, 0);
184  return *this;
185 }
186 
188 {
189  mVec128 = _vmathVfInsert(mVec128, _x.get128(), 0);
190  return *this;
191 }
192 
194 {
195  return floatInVec( mVec128, 0 );
196 }
197 
198 VECTORMATH_FORCE_INLINE Quat & Quat::setY( float _y )
199 {
200  _vmathVfSetElement(mVec128, _y, 1);
201  return *this;
202 }
203 
205 {
206  mVec128 = _vmathVfInsert(mVec128, _y.get128(), 1);
207  return *this;
208 }
209 
211 {
212  return floatInVec( mVec128, 1 );
213 }
214 
215 VECTORMATH_FORCE_INLINE Quat & Quat::setZ( float _z )
216 {
217  _vmathVfSetElement(mVec128, _z, 2);
218  return *this;
219 }
220 
222 {
223  mVec128 = _vmathVfInsert(mVec128, _z.get128(), 2);
224  return *this;
225 }
226 
228 {
229  return floatInVec( mVec128, 2 );
230 }
231 
232 VECTORMATH_FORCE_INLINE Quat & Quat::setW( float _w )
233 {
234  _vmathVfSetElement(mVec128, _w, 3);
235  return *this;
236 }
237 
239 {
240  mVec128 = _vmathVfInsert(mVec128, _w.get128(), 3);
241  return *this;
242 }
243 
245 {
246  return floatInVec( mVec128, 3 );
247 }
248 
249 VECTORMATH_FORCE_INLINE Quat & Quat::setElem( int idx, float value )
250 {
251  _vmathVfSetElement(mVec128, value, idx);
252  return *this;
253 }
254 
256 {
257  mVec128 = _vmathVfInsert(mVec128, value.get128(), idx);
258  return *this;
259 }
260 
261 VECTORMATH_FORCE_INLINE const floatInVec Quat::getElem( int idx ) const
262 {
263  return floatInVec( mVec128, idx );
264 }
265 
267 {
268  return VecIdx( mVec128, idx );
269 }
270 
271 VECTORMATH_FORCE_INLINE const floatInVec Quat::operator []( int idx ) const
272 {
273  return floatInVec( mVec128, idx );
274 }
275 
276 VECTORMATH_FORCE_INLINE const Quat Quat::operator +( const Quat &quat ) const
277 {
278  return Quat( _mm_add_ps( mVec128, quat.mVec128 ) );
279 }
280 
281 
282 VECTORMATH_FORCE_INLINE const Quat Quat::operator -( const Quat &quat ) const
283 {
284  return Quat( _mm_sub_ps( mVec128, quat.mVec128 ) );
285 }
286 
287 VECTORMATH_FORCE_INLINE const Quat Quat::operator *( float scalar ) const
288 {
289  return *this * floatInVec(scalar);
290 }
291 
293 {
294  return Quat( _mm_mul_ps( mVec128, scalar.get128() ) );
295 }
296 
298 {
299  *this = *this + quat;
300  return *this;
301 }
302 
303 VECTORMATH_FORCE_INLINE Quat & Quat::operator -=( const Quat &quat )
304 {
305  *this = *this - quat;
306  return *this;
307 }
308 
309 VECTORMATH_FORCE_INLINE Quat & Quat::operator *=( float scalar )
310 {
311  *this = *this * scalar;
312  return *this;
313 }
314 
316 {
317  *this = *this * scalar;
318  return *this;
319 }
320 
321 VECTORMATH_FORCE_INLINE const Quat Quat::operator /( float scalar ) const
322 {
323  return *this / floatInVec(scalar);
324 }
325 
327 {
328  return Quat( _mm_div_ps( mVec128, scalar.get128() ) );
329 }
330 
332 {
333  *this = *this / scalar;
334  return *this;
335 }
336 
338 {
339  *this = *this / scalar;
340  return *this;
341 }
342 
344 {
345  return Quat(_mm_sub_ps( _mm_setzero_ps(), mVec128 ) );
346 }
347 
348 VECTORMATH_FORCE_INLINE const Quat operator *( float scalar, const Quat &quat )
349 {
350  return floatInVec(scalar) * quat;
351 }
352 
353 VECTORMATH_FORCE_INLINE const Quat operator *( const floatInVec &scalar, const Quat &quat )
354 {
355  return quat * scalar;
356 }
357 
358 VECTORMATH_FORCE_INLINE const floatInVec dot( const Quat &quat0, const Quat &quat1 )
359 {
360  return floatInVec( _vmathVfDot4( quat0.get128(), quat1.get128() ), 0 );
361 }
362 
363 VECTORMATH_FORCE_INLINE const floatInVec norm( const Quat &quat )
364 {
365  return floatInVec( _vmathVfDot4( quat.get128(), quat.get128() ), 0 );
366 }
367 
368 VECTORMATH_FORCE_INLINE const floatInVec length( const Quat &quat )
369 {
370  return floatInVec( _mm_sqrt_ps(_vmathVfDot4( quat.get128(), quat.get128() )), 0 );
371 }
372 
373 VECTORMATH_FORCE_INLINE const Quat normalize( const Quat &quat )
374 {
375  vec_float4 dot =_vmathVfDot4( quat.get128(), quat.get128());
376  return Quat( _mm_mul_ps( quat.get128(), newtonrapson_rsqrt4( dot ) ) );
377 }
378 
379 
380 VECTORMATH_FORCE_INLINE const Quat Quat::rotation( const Vector3 &unitVec0, const Vector3 &unitVec1 )
381 {
382  Vector3 crossVec;
383  __m128 cosAngle, cosAngleX2Plus2, recipCosHalfAngleX2, cosHalfAngleX2, res;
384  cosAngle = _vmathVfDot3( unitVec0.get128(), unitVec1.get128() );
385  cosAngleX2Plus2 = vec_madd( cosAngle, _mm_set1_ps(2.0f), _mm_set1_ps(2.0f) );
386  recipCosHalfAngleX2 = _mm_rsqrt_ps( cosAngleX2Plus2 );
387  cosHalfAngleX2 = vec_mul( recipCosHalfAngleX2, cosAngleX2Plus2 );
388  crossVec = cross( unitVec0, unitVec1 );
389  res = vec_mul( crossVec.get128(), recipCosHalfAngleX2 );
390  VM_ATTRIBUTE_ALIGN16 unsigned int sw[4] = {0, 0, 0, 0xffffffff};
391  res = vec_sel( res, vec_mul( cosHalfAngleX2, _mm_set1_ps(0.5f) ), sw );
392  return Quat( res );
393 }
394 
395 VECTORMATH_FORCE_INLINE const Quat Quat::rotation( float radians, const Vector3 &unitVec )
396 {
397  return rotation( floatInVec(radians), unitVec );
398 }
399 
400 VECTORMATH_FORCE_INLINE const Quat Quat::rotation( const floatInVec &radians, const Vector3 &unitVec )
401 {
402  __m128 s, c, angle, res;
403  angle = vec_mul( radians.get128(), _mm_set1_ps(0.5f) );
404  sincosf4( angle, &s, &c );
405  VM_ATTRIBUTE_ALIGN16 unsigned int sw[4] = {0, 0, 0, 0xffffffff};
406  res = vec_sel( vec_mul( unitVec.get128(), s ), c, sw );
407  return Quat( res );
408 }
409 
410 VECTORMATH_FORCE_INLINE const Quat Quat::rotationX( float radians )
411 {
412  return rotationX( floatInVec(radians) );
413 }
414 
416 {
417  __m128 s, c, angle, res;
418  angle = vec_mul( radians.get128(), _mm_set1_ps(0.5f) );
419  sincosf4( angle, &s, &c );
420  VM_ATTRIBUTE_ALIGN16 unsigned int xsw[4] = {0xffffffff, 0, 0, 0};
421  VM_ATTRIBUTE_ALIGN16 unsigned int wsw[4] = {0, 0, 0, 0xffffffff};
422  res = vec_sel( _mm_setzero_ps(), s, xsw );
423  res = vec_sel( res, c, wsw );
424  return Quat( res );
425 }
426 
427 VECTORMATH_FORCE_INLINE const Quat Quat::rotationY( float radians )
428 {
429  return rotationY( floatInVec(radians) );
430 }
431 
433 {
434  __m128 s, c, angle, res;
435  angle = vec_mul( radians.get128(), _mm_set1_ps(0.5f) );
436  sincosf4( angle, &s, &c );
437  VM_ATTRIBUTE_ALIGN16 unsigned int ysw[4] = {0, 0xffffffff, 0, 0};
438  VM_ATTRIBUTE_ALIGN16 unsigned int wsw[4] = {0, 0, 0, 0xffffffff};
439  res = vec_sel( _mm_setzero_ps(), s, ysw );
440  res = vec_sel( res, c, wsw );
441  return Quat( res );
442 }
443 
444 VECTORMATH_FORCE_INLINE const Quat Quat::rotationZ( float radians )
445 {
446  return rotationZ( floatInVec(radians) );
447 }
448 
450 {
451  __m128 s, c, angle, res;
452  angle = vec_mul( radians.get128(), _mm_set1_ps(0.5f) );
453  sincosf4( angle, &s, &c );
454  VM_ATTRIBUTE_ALIGN16 unsigned int zsw[4] = {0, 0, 0xffffffff, 0};
455  VM_ATTRIBUTE_ALIGN16 unsigned int wsw[4] = {0, 0, 0, 0xffffffff};
456  res = vec_sel( _mm_setzero_ps(), s, zsw );
457  res = vec_sel( res, c, wsw );
458  return Quat( res );
459 }
460 
461 VECTORMATH_FORCE_INLINE const Quat Quat::operator *( const Quat &quat ) const
462 {
463  __m128 ldata, rdata, qv, tmp0, tmp1, tmp2, tmp3;
464  __m128 product, l_wxyz, r_wxyz, xy, qw;
465  ldata = mVec128;
466  rdata = quat.mVec128;
467  tmp0 = _mm_shuffle_ps( ldata, ldata, _MM_SHUFFLE(3,0,2,1) );
468  tmp1 = _mm_shuffle_ps( rdata, rdata, _MM_SHUFFLE(3,1,0,2) );
469  tmp2 = _mm_shuffle_ps( ldata, ldata, _MM_SHUFFLE(3,1,0,2) );
470  tmp3 = _mm_shuffle_ps( rdata, rdata, _MM_SHUFFLE(3,0,2,1) );
471  qv = vec_mul( vec_splat( ldata, 3 ), rdata );
472  qv = vec_madd( vec_splat( rdata, 3 ), ldata, qv );
473  qv = vec_madd( tmp0, tmp1, qv );
474  qv = vec_nmsub( tmp2, tmp3, qv );
475  product = vec_mul( ldata, rdata );
476  l_wxyz = vec_sld( ldata, ldata, 12 );
477  r_wxyz = vec_sld( rdata, rdata, 12 );
478  qw = vec_nmsub( l_wxyz, r_wxyz, product );
479  xy = vec_madd( l_wxyz, r_wxyz, product );
480  qw = vec_sub( qw, vec_sld( xy, xy, 8 ) );
481  VM_ATTRIBUTE_ALIGN16 unsigned int sw[4] = {0, 0, 0, 0xffffffff};
482  return Quat( vec_sel( qv, qw, sw ) );
483 }
484 
485 VECTORMATH_FORCE_INLINE Quat & Quat::operator *=( const Quat &quat )
486 {
487  *this = *this * quat;
488  return *this;
489 }
490 
491 VECTORMATH_FORCE_INLINE const Vector3 rotate( const Quat &quat, const Vector3 &vec )
492 { __m128 qdata, vdata, product, tmp0, tmp1, tmp2, tmp3, wwww, qv, qw, res;
493  qdata = quat.get128();
494  vdata = vec.get128();
495  tmp0 = _mm_shuffle_ps( qdata, qdata, _MM_SHUFFLE(3,0,2,1) );
496  tmp1 = _mm_shuffle_ps( vdata, vdata, _MM_SHUFFLE(3,1,0,2) );
497  tmp2 = _mm_shuffle_ps( qdata, qdata, _MM_SHUFFLE(3,1,0,2) );
498  tmp3 = _mm_shuffle_ps( vdata, vdata, _MM_SHUFFLE(3,0,2,1) );
499  wwww = vec_splat( qdata, 3 );
500  qv = vec_mul( wwww, vdata );
501  qv = vec_madd( tmp0, tmp1, qv );
502  qv = vec_nmsub( tmp2, tmp3, qv );
503  product = vec_mul( qdata, vdata );
504  qw = vec_madd( vec_sld( qdata, qdata, 4 ), vec_sld( vdata, vdata, 4 ), product );
505  qw = vec_add( vec_sld( product, product, 8 ), qw );
506  tmp1 = _mm_shuffle_ps( qv, qv, _MM_SHUFFLE(3,1,0,2) );
507  tmp3 = _mm_shuffle_ps( qv, qv, _MM_SHUFFLE(3,0,2,1) );
508  res = vec_mul( vec_splat( qw, 0 ), qdata );
509  res = vec_madd( wwww, qv, res );
510  res = vec_madd( tmp0, tmp1, res );
511  res = vec_nmsub( tmp2, tmp3, res );
512  return Vector3( res );
513 }
514 
515 VECTORMATH_FORCE_INLINE const Quat conj( const Quat &quat )
516 {
517  VM_ATTRIBUTE_ALIGN16 unsigned int sw[4] = {0x80000000,0x80000000,0x80000000,0};
518  return Quat( vec_xor( quat.get128(), _mm_load_ps((float *)sw) ) );
519 }
520 
521 VECTORMATH_FORCE_INLINE const Quat select( const Quat &quat0, const Quat &quat1, bool select1 )
522 {
523  return select( quat0, quat1, boolInVec(select1) );
524 }
525 
526 //VECTORMATH_FORCE_INLINE const Quat select( const Quat &quat0, const Quat &quat1, const boolInVec &select1 )
527 //{
528 // return Quat( vec_sel( quat0.get128(), quat1.get128(), select1.get128() ) );
529 //}
530 
531 VECTORMATH_FORCE_INLINE void loadXYZW(Quat& quat, const float* fptr)
532 {
533 #ifdef USE_SSE3_LDDQU
534  quat = Quat( SSEFloat(_mm_lddqu_si128((const __m128i*)((float*)(fptr)))).m128 );
535 #else
536  SSEFloat fl;
537  fl.f[0] = fptr[0];
538  fl.f[1] = fptr[1];
539  fl.f[2] = fptr[2];
540  fl.f[3] = fptr[3];
541  quat = Quat( fl.m128);
542 #endif
543 
544 
545 }
546 
547 VECTORMATH_FORCE_INLINE void storeXYZW(const Quat& quat, float* fptr)
548 {
549  fptr[0] = quat.getX();
550  fptr[1] = quat.getY();
551  fptr[2] = quat.getZ();
552  fptr[3] = quat.getW();
553 // _mm_storeu_ps((float*)quat.get128(),fptr);
554 }
555 
556 
557 
558 #ifdef _VECTORMATH_DEBUG
559 
560 VECTORMATH_FORCE_INLINE void print( const Quat &quat )
561 {
562  union { __m128 v; float s[4]; } tmp;
563  tmp.v = quat.get128();
564  printf( "( %f %f %f %f )\n", tmp.s[0], tmp.s[1], tmp.s[2], tmp.s[3] );
565 }
566 
567 VECTORMATH_FORCE_INLINE void print( const Quat &quat, const char * name )
568 {
569  union { __m128 v; float s[4]; } tmp;
570  tmp.v = quat.get128();
571  printf( "%s: ( %f %f %f %f )\n", name, tmp.s[0], tmp.s[1], tmp.s[2], tmp.s[3] );
572 }
573 
574 #endif
575 
576 } // namespace Aos
577 } // namespace Vectormath
578 
579 #endif
const Quat normalize(const Quat &quat)
float getY() const
static const Quat rotationY(float radians)
__m128 vec_float4
#define vec_mergeh(a, b)
float getW() const
Quat & operator*=(const Quat &quat)
Quat & operator-=(const Quat &quat)
#define vec_xor(a, b)
const Quat operator+(const Quat &quat) const
#define vec_madd(a, b, c)
static __m128 sinf4(vec_float4 x)
Quat & setW(float w)
#define vec_cmpgt(a, b)
#define vec_mul(a, b)
Quat & operator=(const Quat &quat)
#define _VECTORMATH_SLERP_TOL
Definition: neon/vec_aos.h:23
Quat & setX(float x)
#define negatef4(x)
const Vector3 rotate(const Quat &quat, const Vector3 &vec)
float & operator[](int idx)
static const Quat identity()
Definition: neon/quat_aos.h:68
#define VECTORMATH_FORCE_INLINE
static __m128 acosf4(__m128 x)
#define vec_sub(a, b)
static const Quat rotationZ(float radians)
static const Quat rotation(const Vector3 &unitVec0, const Vector3 &unitVec1)
#define vec_splat(x, e)
#define _vmathVfSetElement(vec, scalar, slot)
Definition: sse/vec_aos.h:153
#define vec_add(a, b)
static const Quat rotationX(float radians)
void set128(vec_float4 vec)
Definition: sse/quat_aos.h:45
const Quat operator*(const Quat &quat) const
float norm(const Quat &quat)
#define _VECTORMATH_UNIT_0001
Definition: sse/vec_aos.h:59
const Quat operator/(float scalar) const
static __m128 _vmathVfDot4(__m128 vec0, __m128 vec1)
Definition: sse/vec_aos.h:76
const Quat operator-() const
#define VM_ATTRIBUTE_ALIGN16
const Vector3 getXYZ() const
#define vec_nmsub(a, b, c)
#define vec_sld(vec, vec2, x)
__m128 get128() const
Definition: sse/quat_aos.h:158
void loadXYZW(Quat &quat, const float *fptr)
__m128 get128() const
const Quat conj(const Quat &quat)
static __m128 newtonrapson_rsqrt4(const __m128 v)
static __m128 _vmathVfInsert(__m128 dst, __m128 src, int slot)
Definition: sse/vec_aos.h:143
static void sincosf4(vec_float4 x, vec_float4 *s, vec_float4 *c)
Quat & operator/=(float scalar)
void storeXYZW(const Quat &quat, float *fptr)
const Quat lerp(float t, const Quat &quat0, const Quat &quat1)
Definition: neon/quat_aos.h:73
const Matrix3 select(const Matrix3 &mat0, const Matrix3 &mat1, bool select1)
Definition: neon/mat_aos.h:409
Quat & setElem(int idx, float value)
float getZ() const
float getElem(int idx) const
Quat & setY(float y)
const Quat squad(float t, const Quat &unitQuat0, const Quat &unitQuat1, const Quat &unitQuat2, const Quat &unitQuat3)
float dot(const Quat &quat0, const Quat &quat1)
Quat & setZ(float z)
const Vector3 cross(const Vector3 &vec0, const Vector3 &vec1)
Definition: neon/vec_aos.h:473
__m128 get128() const
Definition: sse/vec_aos.h:817
__m128 get128() const
Definition: sse/vec_aos.h:327
Quat & setXYZ(const Vector3 &vec)
float length(const Quat &quat)
static __m128 vec_sel(__m128 a, __m128 b, __m128 mask)
static __m128 _vmathVfDot3(__m128 vec0, __m128 vec1)
Definition: sse/vec_aos.h:70
const Matrix3 operator*(float scalar, const Matrix3 &mat)
Definition: neon/mat_aos.h:257
float getX() const
Quat & operator+=(const Quat &quat)
const Quat slerp(float t, const Quat &unitQuat0, const Quat &unitQuat1)
Definition: neon/quat_aos.h:78