AGX Dynamics 2.42.3.0
Loading...
Searching...
No Matches
QuatTemplate.h
Go to the documentation of this file.
1/*
2Copyright 2007-2025. Algoryx Simulation AB.
3
4All AGX source code, intellectual property, documentation, sample code,
5tutorials, scene files and technical white papers, are copyrighted, proprietary
6and confidential material of Algoryx Simulation AB. You may not download, read,
7store, distribute, publish, copy or otherwise disseminate, use or expose this
8material unless having a written signed agreement with Algoryx Simulation AB, or having been
9advised so by Algoryx Simulation AB for a time limited evaluation, or having purchased a
10valid commercial license from Algoryx Simulation AB.
11
12Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13from using this software, unless otherwise stated in written agreements with
14Algoryx Simulation AB.
15*/
16
17
18
19#ifndef AGX_QUATTEMPLATE_H
20#define AGX_QUATTEMPLATE_H
21
22#include <agx/agxCore_export.h>
23
24#include <agx/agx.h>
25#include <agx/Vec3.h>
26#include <agx/Vec4.h>
27#include <agx/EulerConvention.h>
28
29#ifdef _MSC_VER
30# pragma warning(push)
31# pragma warning(disable: 6385) // Disable warning C6385: Reading invalid data
32#endif
33
34
35namespace agx
36{
37 class EulerAngles;
38 class OrthoMatrix3x3;
39
40 template <typename T>
41 class AffineMatrix4x4T;
42
55 template <typename T>
56 class QuatT
57 {
58 public:
59
60 typedef T Type;
61
64
66 QuatT( T x, T y, T z, T w );
67
69 explicit QuatT( const Vec4T<T>& v );
70
72 QuatT( T angle, const Vec3T<T>& axis );
73
77 QuatT( T angle1, const Vec3T<T>& axis1,
78 T angle2, const Vec3T<T>& axis2,
79 T angle3, const Vec3T<T>& axis3 );
80
84 QuatT( const Vec3T<T>& from, const Vec3T<T>& to );
85
89 explicit QuatT( const EulerAngles& euler);
90
91
93 QuatT(const QuatT<T>& copy ) = default;
94
96 template <typename T2>
97 explicit QuatT(const QuatT<T2>& copy );
98
102 explicit QuatT( const AffineMatrix4x4T<T>& matrix );
103
106
111 bool operator == ( const QuatT<T>& v ) const;
112
116 bool operator != ( const QuatT<T>& v ) const;
117
118 /* ----------------------------------
119 Methods to access data members
120 ---------------------------------- */
121
124
127
129 void set( T x, T y, T z, T w );
130
132 void set( const Vec4T<T>& v );
133
138 void get( EulerAngles& euler ) const;
139
145
150 void get( AffineMatrix4x4T<T>& matrix ) const;
151
156 void get(OrthoMatrix3x3& matrix) const;
157
163 void get( T& angle, agx::Vec3T<T>& axis ) const;
164
165
170 QuatT<T>& set( const EulerAngles& euler );
171
177
182 QuatT<T>& set( const OrthoMatrix3x3& matrix );
183
184
186 T& operator [] ( size_t i );
187
189 T operator [] ( size_t i ) const;
190
192 T& x();
193
195 T& y();
196
198 T& z();
199
201 T& w();
202
203
205 T x() const;
206
208 T y() const;
209
211 T z() const;
212
214 T w() const;
215
219 bool zeroRotation() const;
220
221
222 /* -------------------------------------------------------------
223 BASIC ARITHMETIC METHODS
224 Implemented in terms of Vec4s. Some Vec4 operators, e.g.
225 operator* are not appropriate for quaternions (as
226 mathematical objects) so they are implemented differently.
227 Also define methods for conjugate and the multiplicative inverse.
228 ------------------------------------------------------------- */
230 const QuatT<T> operator * ( T rhs ) const;
231
234
239 const QuatT<T> operator*( const QuatT<T>& rhs ) const;
240
246
251 const QuatT<T> leftMult( const QuatT<T>& rhs ) const;
252
257 const QuatT<T> rightMult( const QuatT<T>& rhs ) const;
258
259
261 QuatT<T> operator / ( T rhs ) const;
262
265
267 const QuatT<T> operator/( const QuatT<T>& denom ) const;
268
270 QuatT<T>& operator/=( const QuatT<T>& denom );
271
273 const QuatT<T> operator + ( const QuatT<T>& rhs ) const;
274
277
279 const QuatT<T> operator - ( const QuatT<T>& rhs ) const;
280
283
288 const QuatT<T> operator - () const;
289
291 T length() const;
292
294 T length2() const;
295
297 QuatT<T> conj () const;
298
301
305 void setRotate( T angle, T x, T y, T z );
306
310 void setRotate( T angle, const Vec3T<T>& vec );
311
317 void setRotate ( T angle1, const Vec3T<T>& axis1,
318 T angle2, const Vec3T<T>& axis2,
319 T angle3, const Vec3T<T>& axis3 );
320
328 void setRotate( const Vec3T<T>& from, const Vec3T<T>& to );
329
333 static QuatT<T> rotate( T angle, T x, T y, T z );
334
338 static QuatT<T> rotate( T angle, const Vec3T<T>& vec );
339
345 static QuatT<T> rotate( T angle1, const Vec3T<T>& axis1,
346 T angle2, const Vec3T<T>& axis2,
347 T angle3, const Vec3T<T>& axis3 );
348
352 static QuatT<T> rotate( const Vec3T<T>& from, const Vec3T<T>& to );
353
357 void getRotate( T& angle, T& x, T& y, T& z ) const;
358
362 void getRotate( T& angle, Vec3T<T>& vec ) const;
363
368
373
378 void slerp( T t, const QuatT<T>& from, const QuatT<T>& to );
379
383 Vec3T<T> operator* ( const Vec3T<T>& v ) const;
384
390
394 T* ptr();
395
399 const T* ptr() const;
400
401 protected:
402 T m_data[4];
403 };
404
405
406 /* Implementation */
407 template <typename T>
409 {
410 m_data[0] = 0.0;
411 m_data[1] = 0.0;
412 m_data[2] = 0.0;
413 m_data[3] = 1.0;
414 }
415
416 template <typename T>
417 AGX_FORCE_INLINE QuatT<T>::QuatT( T x, T y, T z, T w )
418 {
419 m_data[0] = x;
420 m_data[1] = y;
421 m_data[2] = z;
422 m_data[3] = w;
423 }
424
425 template <typename T>
427 {
428 m_data[0] = v.x();
429 m_data[1] = v.y();
430 m_data[2] = v.z();
431 m_data[3] = v.w();
432 }
433
434 template <typename T>
436 {
437 setRotate( angle, axis );
438 }
439
440 template <typename T>
442 T angle2, const Vec3T<T>& axis2,
443 T angle3, const Vec3T<T>& axis3 )
444 {
445 setRotate( angle1, axis1, angle2, axis2, angle3, axis3 );
446 }
447
448 template <typename T>
450 {
451 setRotate( from, to );
452 }
453
454
455 template <typename T>
456 template <typename T2>
458 {
459 m_data[ 0 ] = (T)copy[ 0 ];
460 m_data[ 1 ] = (T)copy[ 1 ];
461 m_data[ 2 ] = (T)copy[ 2 ];
462 m_data[ 3 ] = (T)copy[ 3 ];
463 }
464
465 template <typename T>
467 {
468 set( matrix );
469 }
470
471
472 template <typename T>
474 {
475 m_data[0] = v.m_data[0];
476 m_data[1] = v.m_data[1];
477 m_data[2] = v.m_data[2];
478 m_data[3] = v.m_data[3];
479 return *this;
480 }
481
482 template <typename T>
484 {
485 return m_data[0] == v.m_data[0] && m_data[1] == v.m_data[1] && m_data[2] == v.m_data[2] && m_data[3] == v.m_data[3];
486 }
487
488 template <typename T>
490 {
491 return m_data[0] != v.m_data[0] || m_data[1] != v.m_data[1] || m_data[2] != v.m_data[2] || m_data[3] != v.m_data[3];
492 }
493
494 template <typename T>
496 {
497 return Vec4T<T>( m_data[0], m_data[1], m_data[2], m_data[3] );
498 }
499
500 template <typename T>
502 {
503 return Vec3T<T>( m_data[0], m_data[1], m_data[2] );
504 }
505
506 template <typename T>
507 AGX_FORCE_INLINE void QuatT<T>::set( T x, T y, T z, T w )
508 {
509 m_data[0] = x;
510 m_data[1] = y;
511 m_data[2] = z;
512 m_data[3] = w;
513 }
514
515 template <typename T>
517 {
518 m_data[0] = v.x();
519 m_data[1] = v.y();
520 m_data[2] = v.z();
521 m_data[3] = v.w();
522 }
523
524 template <typename T>
526 {
527 agxAssert( i < 4 );
528 return m_data[i];
529 }
530
531 template <typename T>
533 {
534 agxAssert( i < 4 );
535 return m_data[i];
536 }
537
538 template <typename T>
540 {
541 return m_data[0];
542 }
543
544 template <typename T>
546 {
547 return m_data[1];
548 }
549
550 template <typename T>
552 {
553 return m_data[2];
554 }
555
556 template <typename T>
558 {
559 return m_data[3];
560 }
561
562 template <typename T>
564 {
565 return m_data[0];
566 }
567
568 template <typename T>
570 {
571 return m_data[1];
572 }
573
574 template <typename T>
576 {
577 return m_data[2];
578 }
579
580 template <typename T>
582 {
583 return m_data[3];
584 }
585
586 template <typename T>
587 inline bool QuatT<T>::zeroRotation() const
588 {
589 return m_data[0] == 0.0 && m_data[1] == 0.0 && m_data[2] == 0.0 && m_data[3] == 1.0;
590 }
591
592
593 template <typename T>
595 {
596 return QuatT( m_data[0] * rhs, m_data[1] * rhs, m_data[2] * rhs, m_data[3] * rhs );
597 }
598
599 template <typename T>
601 {
602 m_data[0] *= rhs;
603 m_data[1] *= rhs;
604 m_data[2] *= rhs;
605 m_data[3] *= rhs;
606 return *this; // enable nesting
607 }
608
609 template <typename T>
611 {
612 return QuatT( rhs.m_data[3] * m_data[0] + rhs.m_data[0] * m_data[3] + rhs.m_data[1] * m_data[2] - rhs.m_data[2] * m_data[1],
613 rhs.m_data[3] * m_data[1] - rhs.m_data[0] * m_data[2] + rhs.m_data[1] * m_data[3] + rhs.m_data[2] * m_data[0],
614 rhs.m_data[3] * m_data[2] + rhs.m_data[0] * m_data[1] - rhs.m_data[1] * m_data[0] + rhs.m_data[2] * m_data[3],
615 rhs.m_data[3] * m_data[3] - rhs.m_data[0] * m_data[0] - rhs.m_data[1] * m_data[1] - rhs.m_data[2] * m_data[2] );
616 }
617
618 template <typename T>
620 {
621 T x = rhs.m_data[3] * m_data[0] + rhs.m_data[0] * m_data[3] + rhs.m_data[1] * m_data[2] - rhs.m_data[2] * m_data[1];
622 T y = rhs.m_data[3] * m_data[1] - rhs.m_data[0] * m_data[2] + rhs.m_data[1] * m_data[3] + rhs.m_data[2] * m_data[0];
623 T z = rhs.m_data[3] * m_data[2] + rhs.m_data[0] * m_data[1] - rhs.m_data[1] * m_data[0] + rhs.m_data[2] * m_data[3];
624 m_data[3] = rhs.m_data[3] * m_data[3] - rhs.m_data[0] * m_data[0] - rhs.m_data[1] * m_data[1] - rhs.m_data[2] * m_data[2];
625
626 m_data[2] = z;
627 m_data[1] = y;
628 m_data[0] = x;
629
630 return ( *this ); // enable nesting
631 }
632
633 template <typename T>
635 {
636 return (*this) * rhs ;
637 }
638
639 template <typename T>
641 {
642 return rhs * (*this) ;
643 }
644
645
646 template <typename T>
648 {
649 T div = T(1) / rhs;
650 return QuatT( m_data[0] * div, m_data[1] * div, m_data[2] * div, m_data[3] * div );
651 }
652
653 template <typename T>
655 {
656 T div = T(1) / rhs;
657 m_data[0] *= div;
658 m_data[1] *= div;
659 m_data[2] *= div;
660 m_data[3] *= div;
661 return *this;
662 }
663
664 template <typename T>
666 {
667 return ( ( *this ) * denom.inverse() );
668 }
669
670 template <typename T>
672 {
673 ( *this ) = ( *this ) * denom.inverse();
674 return ( *this ); // enable nesting
675 }
676
677 template <typename T>
679 {
680 return QuatT( m_data[0] + rhs.m_data[0], m_data[1] + rhs.m_data[1],
681 m_data[2] + rhs.m_data[2], m_data[3] + rhs.m_data[3] );
682 }
683
684 template <typename T>
686 {
687 m_data[0] += rhs.m_data[0];
688 m_data[1] += rhs.m_data[1];
689 m_data[2] += rhs.m_data[2];
690 m_data[3] += rhs.m_data[3];
691 return *this; // enable nesting
692 }
693
694 template <typename T>
696 {
697 return QuatT( m_data[0] - rhs.m_data[0], m_data[1] - rhs.m_data[1],
698 m_data[2] - rhs.m_data[2], m_data[3] - rhs.m_data[3] );
699 }
700
701 template <typename T>
703 {
704 m_data[0] -= rhs.m_data[0];
705 m_data[1] -= rhs.m_data[1];
706 m_data[2] -= rhs.m_data[2];
707 m_data[3] -= rhs.m_data[3];
708 return *this; // enable nesting
709 }
710
711 template <typename T>
713 {
714 return QuatT<T> ( -m_data[0], -m_data[1], -m_data[2], -m_data[3] );
715 }
716
717 template <typename T>
719 {
720 return std::sqrt( m_data[0] * m_data[0] + m_data[1] * m_data[1] + m_data[2] * m_data[2] + m_data[3] * m_data[3] );
721 }
722
723 template <typename T>
725 {
726 return m_data[0] * m_data[0] + m_data[1] * m_data[1] + m_data[2] * m_data[2] + m_data[3] * m_data[3];
727 }
728
729 template <typename T>
731 {
732 return QuatT( -m_data[0], -m_data[1], -m_data[2], m_data[3] );
733 }
734
735 template <typename T>
737 {
738 return conj() / length2();
739 }
740
741
742 template <typename T>
744 {
745 return rotate( angle, Vec3T<T>( x, y, z ) );
746 }
747
748 template <typename T>
750 {
751 QuatT<T> q;
752 q.setRotate( angle, vec );
753 return q;
754 }
755
756 template <typename T>
758 T angle2, const Vec3T<T>& axis2,
759 T angle3, const Vec3T<T>& axis3 )
760 {
761 QuatT<T> q;
762 q.setRotate( angle1, axis1, angle2, axis2, angle3, axis3 );
763 return q;
764 }
765
766 template <typename T>
768 {
769 QuatT<T> q;
770 q.setRotate( from, to );
771 return q;
772 }
773
774
775 template <typename T>
776 inline Vec3T<T> QuatT<T>::operator* ( const Vec3T<T>& v ) const
777 {
778 // nVidia SDK implementation
779 Vec3T<T> uv, uuv;
780 Vec3T<T> qvec( m_data[0], m_data[1], m_data[2] );
781 uv = qvec ^ v;
782 uuv = qvec ^ uv;
783 uv *= ( 2.0f * m_data[3] );
784 uuv *= 2.0f;
785 return v + uv + uuv;
786 }
787
788 template <typename T>
790 {
791 T norm = this->length();
792 if ( norm > 0.0 ) {
793 T inv = 1.0f / norm;
794 m_data[0] *= inv;
795 m_data[1] *= inv;
796 m_data[2] *= inv;
797 m_data[3] *= inv;
798 }
799 return( norm );
800 }
801
802
803 template <typename T>
805 {
806 return m_data;
807 }
808
809 template <typename T>
811 {
812 return m_data;
813 }
814
815
816 template <typename T>
818 {
819 return
820 agx::equivalent(a[0], b[0], epsilon) &&
821 agx::equivalent(a[1], b[1], epsilon) &&
822 agx::equivalent(a[2], b[2], epsilon) &&
823 agx::equivalent(a[3], b[3], epsilon);
824 }
825
826
827 template <typename T>
828 inline std::ostream& operator << ( std::ostream& output, const QuatT<T>& quat )
829 {
830 output << quat[0] << " "
831 << quat[1] << " "
832 << quat[2] << " "
833 << quat[3];
834 return output; // to enable cascading
835 }
836
837}
838
839#ifdef _MSC_VER
840# pragma warning(pop)
841#endif
842
843#endif /* AGX_QUATTEMPLATE_H */
Matrix class for rigid transformations (translation, rotation).
This class provides conversion services between Euler angles in any of the 24 conventions and corresp...
Definition: EulerAngles.h:70
Convention
The 24 Euler conventions.
@ DEFAULT_CONVENTION
The default Euler convention used by agx.
Specialized types of matrices for holding orthogonal transformation matrices.
The object holding quaternions and providing operations on these.
Definition: QuatTemplate.h:57
const T * ptr() const
Definition: QuatTemplate.h:810
T normalize()
Normalize the quat so that it has unit length.
Definition: QuatTemplate.h:789
agx::Real getAngle() const
Get the rotation angle represented by the quaternion.
void getRotate(T &angle, T &x, T &y, T &z) const
Get the angle and vector components represented by the quaternion.
QuatT< T > inverse() const
Multiplicative inverse method: q^(-1) = q^*‍/(q.q^*)
Definition: QuatTemplate.h:736
QuatT()
Default constructor. Create a Quaternion with an identity rotation.
Definition: QuatTemplate.h:408
T & operator[](size_t i)
Definition: QuatTemplate.h:525
agx::Vec3T< T > getUnitVector() const
Get the rotation unit vector represented by the quaternion.
const QuatT< T > operator/(const QuatT< T > &denom) const
Binary divide.
Definition: QuatTemplate.h:665
T length2() const
Definition: QuatTemplate.h:724
QuatT< T > & operator/=(T rhs)
Unary divide by scalar rhs.
Definition: QuatTemplate.h:654
QuatT< T > & operator*=(T rhs)
Unary multiply by scalar rhs.
Definition: QuatTemplate.h:600
bool operator!=(const QuatT< T > &v) const
Definition: QuatTemplate.h:489
QuatT< T > & operator=(const QuatT< T > &v)
Assignment operator.
Definition: QuatTemplate.h:473
void slerp(T t, const QuatT< T > &from, const QuatT< T > &to)
Spherical Linear Interpolation.
static QuatT< T > rotate(const Vec3T< T > &from, const Vec3T< T > &to)
Static method which constructs and returns a Quaternion from rotating vector from to vector to.
Definition: QuatTemplate.h:767
bool zeroRotation() const
Definition: QuatTemplate.h:587
void set(const Vec4T< T > &v)
Set the four elements of the quaternion as an Vec4.
Definition: QuatTemplate.h:516
const QuatT< T > rightMult(const QuatT< T > &rhs) const
Binary RIGHT multiplication: q = p * rhs ; results in q = p quatmultiply rhs ;.
Definition: QuatTemplate.h:640
void setRotate(const Vec3T< T > &from, const Vec3T< T > &to)
Make a rotation QuatT<T> which will rotate from to to Generally take a dot product to get the angle b...
static QuatT< T > rotate(T angle, T x, T y, T z)
Static method which constructs and returns a Quaternion from a rotation given as angle radians around...
Definition: QuatTemplate.h:743
QuatT< T > conj() const
Definition: QuatTemplate.h:730
QuatT< T > & operator*=(const QuatT< T > &rhs)
Unary LEFT multiply: result is this = rhs quatmultiply this, which makes sense since the notation sug...
Definition: QuatTemplate.h:619
void get(EulerAngles &euler) const
Convert this quaternion to an EulerAngles representation.
T z() const
Definition: QuatTemplate.h:575
QuatT(T angle, const Vec3T< T > &axis)
Create a Quaternion calculated from a rotation of angle radians around the rotation axis axis.
Definition: QuatTemplate.h:435
QuatT(T angle1, const Vec3T< T > &axis1, T angle2, const Vec3T< T > &axis2, T angle3, const Vec3T< T > &axis3)
Create a Quaternion based on the concatenation between the three specified angle and axis.
Definition: QuatTemplate.h:441
static QuatT< T > rotate(T angle, const Vec3T< T > &vec)
Static method which constructs and returns a Quaternion from a rotation given as angle radians around...
Definition: QuatTemplate.h:749
const QuatT< T > leftMult(const QuatT< T > &rhs) const
Binary left multiplication: q = p * rhs; results in the OTHER WAY AROUND: q = rhs quatmultiply p;.
Definition: QuatTemplate.h:634
QuatT(const AffineMatrix4x4T< T > &matrix)
Create a Quaternion based on the rotation part in the specified Affine 4x4 transformation matrix.
Definition: QuatTemplate.h:466
void setRotate(T angle1, const Vec3T< T > &axis1, T angle2, const Vec3T< T > &axis2, T angle3, const Vec3T< T > &axis3)
Set the rotation of this Quaternion as a concatenation of the three angle/axis rotations:
QuatT< T > & set(const EulerAngles &euler)
Set this quaternion with the rotation described by the EulerAngles representation.
QuatT< T > & set(const OrthoMatrix3x3 &matrix)
Set this quaternion with the rotation described by a OrthoMatrix3x3.
void get(T &angle, agx::Vec3T< T > &axis) const
Convert a Quaternion to an axis and angle representation.
QuatT(T x, T y, T z, T w)
Create a Quaternion with the specified scalar values.
Definition: QuatTemplate.h:417
void setRotate(T angle, T x, T y, T z)
Set the rotation of the Quaternion as a rotation angle radians around the vector (x,...
void get(OrthoMatrix3x3 &matrix) const
Set an OrthoMatrix3x3 to represent the same rotation as the quaternion.
Vec3T< T > asVec3() const
Definition: QuatTemplate.h:501
const QuatT< T > operator*(T rhs) const
Multiply by scalar rhs.
Definition: QuatTemplate.h:594
T y() const
Definition: QuatTemplate.h:569
QuatT(const Vec4T< T > &v)
Create a Quaternion based on the 4D vector (x,y,z,w)
Definition: QuatTemplate.h:426
T w() const
Definition: QuatTemplate.h:581
Vec3T< T > getAsEulerAngles(agx::EulerConvention::Convention convention=agx::EulerConvention::Convention::DEFAULT_CONVENTION) const
Convert to Euler anglers.
QuatT(const EulerAngles &euler)
Create a Quaternion based on the rotation from euler specified as a EulerAngle.
Vec4T< T > asVec4() const
Definition: QuatTemplate.h:495
const QuatT< T > operator*(const QuatT< T > &rhs) const
Binary LEFT multiply: result is q = rhs quatmultiply this, even though the notation is q = this * rhs...
Definition: QuatTemplate.h:610
QuatT(const QuatT< T > &copy)=default
Copy constructor.
void get(AffineMatrix4x4T< T > &matrix) const
Set the Rotational part of matrix from this quaternion.
void setRotate(T angle, const Vec3T< T > &vec)
Set the rotation of this Quaternion as a rotation angle radians around the vector vec.
T length() const
Definition: QuatTemplate.h:718
bool operator==(const QuatT< T > &v) const
Test for equality.
Definition: QuatTemplate.h:483
const QuatT< T > operator-() const
Negation operator - returns the negative of the quaternion.
Definition: QuatTemplate.h:712
QuatT(const QuatT< T2 > &copy)
Copy constructor for other types.
Definition: QuatTemplate.h:457
void getRotate(T &angle, Vec3T< T > &vec) const
Get the angle and vector represented by the quaternion.
const QuatT< T > operator+(const QuatT< T > &rhs) const
Binary addition.
Definition: QuatTemplate.h:678
T x() const
Definition: QuatTemplate.h:563
void set(T x, T y, T z, T w)
Set the 4 elements of the quaternion as 4 scalars.
Definition: QuatTemplate.h:507
QuatT(const Vec3T< T > &from, const Vec3T< T > &to)
Create a Quaternion which maps the rotation from vector from to the vector to.
Definition: QuatTemplate.h:449
QuatT< T > & operator/=(const QuatT< T > &denom)
Unary divide.
Definition: QuatTemplate.h:671
QuatT< T > & set(const AffineMatrix4x4T< T > &matrix)
Set this quaternion with the rotational part of matrix.
QuatT< T > & operator+=(const QuatT< T > &rhs)
Unary addition.
Definition: QuatTemplate.h:685
QuatT< T > operator/(T rhs) const
Divide by scalar rhs.
Definition: QuatTemplate.h:647
QuatT< T > & operator-=(const QuatT< T > &rhs)
Unary subtraction.
Definition: QuatTemplate.h:702
static QuatT< T > rotate(T angle1, const Vec3T< T > &axis1, T angle2, const Vec3T< T > &axis2, T angle3, const Vec3T< T > &axis3)
Static method which constructs and returns a Quaternion from a rotation given as a concatenation of t...
Definition: QuatTemplate.h:757
A class holding 3 dimensional vectors and providing basic arithmetic.
Definition: Vec3Template.h:46
A class holding 4 dimensional vectors and providing basic arithmetic.
Definition: Vec4Template.h:35
#define agxAssert(expr)
Definition: debug.h:143
#define AGX_FORCE_INLINE
Definition: macros.h:58
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
std::ostream & operator<<(std::ostream &os, const agx::AddedMassInteraction::Matrix6x6 &m)
double Real
Definition: Real.h:41
static constexpr Real AGX_EQUIVALENT_EPSILON
Definition: Math.h:57
AGXPHYSICS_EXPORT agx::Bool equivalent(const agx::AddedMassInteraction::Matrix6x6 &lhs, const agx::AddedMassInteraction::Matrix6x6 &rhs, agx::Real eps=agx::RealEpsilon)