![]() |
AGX Dynamics 2.40.0.0
|
A class holding 4 dimensional vectors and providing basic arithmetic. More...
#include <Vec4Template.h>
Public Types | |
typedef T | Type |
Public Member Functions | |
Vec4T () | |
Default constructor. | |
Vec4T (const T v[4]) | |
Constructor, initialize elements with the specified scalars. | |
Vec4T (const Vec3T< T > &v3, T w) | |
Constructor, initialize the first three elements with v3 and the last with w . | |
Vec4T (const Vec4T ©)=default | |
Copy constructor. | |
template<typename T2 > | |
Vec4T (const Vec4T< T2 > ©) | |
Copy constructor for other types. | |
Vec4T (T r) | |
Constructor, fill all elements with scalar r . | |
Vec4T (T x, T y, T z, T w) | |
Constructor, initialize elements with the specified scalars. | |
Vec3T< T > | asVec3 () const |
void | clamp (const Vec4T &min, const Vec4T &max) |
Clamp a vector between a lower and upper bound (per component). | |
Real | distance (const Vec4T &v2) const |
Real | distance2 (const Vec4T &v2) const |
Real | distance2 (const Vec4T &v2) const |
Real | distance2 (const Vec4T &v2) const |
Real | distance2 (const Vec4T &v2) const |
Real | distance2 (const Vec4T &v2) const |
bool | equalsZero () const |
bool | isFinite () const |
bool | isNaN () const |
bool | isValid () const |
Real | length () const |
Real | length2 () const |
T | maxComponent () const |
size_t | maxElement () const |
T | minComponent () const |
size_t | minElement () const |
Real | normalize () |
Normalize the vector so that it has length unity. | |
bool | operator!= (const Vec4T &v) const |
In-equality test. | |
T | operator* (const Vec4T &rhs) const |
const Vec4T | operator* (T rhs) const |
Vec4T & | operator*= (T rhs) |
const Vec4T | operator+ (const T &rhs) const |
Binary vector add. | |
const Vec4T | operator+ (const Vec4T &rhs) const |
Binary vector add. | |
Vec4T & | operator+= (const T &rhs) |
Unary vector add. | |
Vec4T & | operator+= (const Vec4T &rhs) |
Unary vector add. | |
const Vec4T | operator- () const |
Negation operator. | |
const Vec4T | operator- (const T &rhs) const |
Binary vector subtract. | |
const Vec4T | operator- (const Vec4T &rhs) const |
Binary vector subtract. | |
Vec4T & | operator-= (const T &rhs) |
Unary vector subtract. | |
Vec4T & | operator-= (const Vec4T &rhs) |
Unary vector subtract. | |
const Vec4T | operator/ (T rhs) const |
Divide by scalar. | |
Vec4T & | operator/= (T rhs) |
bool | operator== (const Vec4T &v) const |
Equality test. | |
T & | operator[] (size_t i) |
const T & | operator[] (size_t i) const |
const Vec4T | operator| (const Vec4T &rhs) const |
T * | ptr () |
const T * | ptr () const |
void | set (const Vec4T &rhs) |
Set the value of the vector with rhs . | |
void | set (T value) |
Set all elements of the vector with scalar value value . | |
void | set (T x, T y, T z, T w) |
Set the elements of the vector. | |
T & | w () |
T | w () const |
T & | x () |
T | x () const |
T & | y () |
T | y () const |
T & | z () |
T | z () const |
Static Public Member Functions | |
static Vec4T | componentMax (const Vec4T &v1, const Vec4T &v2) |
static Vec4T | componentMin (const Vec4T &v1, const Vec4T &v2) |
static Vec4T | random (const Vec4T &min, const Vec4T &max) |
static Vec4T | random (T min, T max) |
A class holding 4 dimensional vectors and providing basic arithmetic.
Definition at line 34 of file Vec4Template.h.
typedef T agx::Vec4T< T >::Type |
Definition at line 37 of file Vec4Template.h.
|
default |
Copy constructor.
|
explicit |
Copy constructor for other types.
Definition at line 298 of file Vec4Template.h.
agx::Vec4T< T >::Vec4T |
Default constructor.
Definition at line 309 of file Vec4Template.h.
|
explicit |
Constructor, fill all elements with scalar r
.
Definition at line 318 of file Vec4Template.h.
agx::Vec4T< T >::Vec4T | ( | T | x, |
T | y, | ||
T | z, | ||
T | w | ||
) |
Constructor, initialize elements with the specified scalars.
Definition at line 324 of file Vec4Template.h.
|
explicit |
Constructor, initialize elements with the specified scalars.
Definition at line 333 of file Vec4Template.h.
agx::Vec4T< T >::Vec4T | ( | const Vec3T< T > & | v3, |
T | w | ||
) |
Constructor, initialize the first three elements with v3
and the last with w
.
Definition at line 342 of file Vec4Template.h.
Vec3T< T > agx::Vec4T< T >::asVec3 |
Definition at line 702 of file Vec4Template.h.
void agx::Vec4T< T >::clamp | ( | const Vec4T< T > & | min, |
const Vec4T< T > & | max | ||
) |
Clamp a vector between a lower and upper bound (per component).
Definition at line 419 of file Vec4Template.h.
References agx::clamp(), agx::max(), and agx::min().
Referenced by agx::clamp().
|
static |
Definition at line 371 of file Vec4Template.h.
|
static |
Definition at line 365 of file Vec4Template.h.
Real agx::Vec4T< T >::distance | ( | const Vec4T< T > & | v2 | ) | const |
Definition at line 681 of file Vec4Template.h.
Real agx::Vec4T< T >::distance2 | ( | const Vec4T< T > & | v2 | ) | const |
Definition at line 762 of file Vec4Template.h.
References agx::Vec4T< T >::length2().
Real agx::Vec4T< UInt8 >::distance2 | ( | const Vec4T< T > & | v2 | ) | const |
Definition at line 770 of file Vec4Template.h.
References agx::Vec4T< T >::length2().
Real agx::Vec4T< UInt16 >::distance2 | ( | const Vec4T< T > & | v2 | ) | const |
Definition at line 782 of file Vec4Template.h.
References agx::Vec4T< T >::length2().
Real agx::Vec4T< UInt32 >::distance2 | ( | const Vec4T< T > & | v2 | ) | const |
Definition at line 794 of file Vec4Template.h.
References agx::Vec4T< T >::length2().
Real agx::Vec4T< UInt64 >::distance2 | ( | const Vec4T< T > & | v2 | ) | const |
Definition at line 806 of file Vec4Template.h.
References agx::Vec4T< T >::length2().
bool agx::Vec4T< T >::equalsZero |
Definition at line 429 of file Vec4Template.h.
References agx::equalsZero().
bool agx::Vec4T< T >::isFinite |
Definition at line 543 of file Vec4Template.h.
References agx::isFinite().
bool agx::Vec4T< T >::isNaN |
Definition at line 537 of file Vec4Template.h.
References agx::isNaN().
bool agx::Vec4T< T >::isValid |
Definition at line 531 of file Vec4Template.h.
References agx::isNaN().
Real agx::Vec4T< T >::length |
Definition at line 668 of file Vec4Template.h.
Referenced by agx::Vec4T< T >::normalize().
Real agx::Vec4T< T >::length2 |
Definition at line 674 of file Vec4Template.h.
Referenced by agx::Vec4T< T >::distance2().
T agx::Vec4T< T >::maxComponent |
Definition at line 383 of file Vec4Template.h.
size_t agx::Vec4T< T >::maxElement |
Definition at line 404 of file Vec4Template.h.
References agx::absolute().
T agx::Vec4T< T >::minComponent |
Definition at line 377 of file Vec4Template.h.
size_t agx::Vec4T< T >::minElement |
Definition at line 389 of file Vec4Template.h.
References agx::absolute().
Real agx::Vec4T< T >::normalize |
Normalize the vector so that it has length unity.
Definition at line 688 of file Vec4Template.h.
References agx::Vec4T< T >::length().
bool agx::Vec4T< T >::operator!= | ( | const Vec4T< T > & | v | ) | const |
In-equality test.
Definition at line 358 of file Vec4Template.h.
T agx::Vec4T< T >::operator* | ( | const Vec4T< T > & | rhs | ) | const |
Definition at line 549 of file Vec4Template.h.
const Vec4T< T > agx::Vec4T< T >::operator* | ( | T | rhs | ) | const |
rhs
. Definition at line 564 of file Vec4Template.h.
Vec4T< T > & agx::Vec4T< T >::operator*= | ( | T | rhs | ) |
rhs
Definition at line 571 of file Vec4Template.h.
const Vec4T< T > agx::Vec4T< T >::operator+ | ( | const T & | rhs | ) | const |
Binary vector add.
Definition at line 630 of file Vec4Template.h.
const Vec4T< T > agx::Vec4T< T >::operator+ | ( | const Vec4T< T > & | rhs | ) | const |
Binary vector add.
rhs
Definition at line 598 of file Vec4Template.h.
Vec4T< T > & agx::Vec4T< T >::operator+= | ( | const T & | rhs | ) |
Unary vector add.
Slightly more efficient because no temporary intermediate object.
Definition at line 636 of file Vec4Template.h.
Vec4T< T > & agx::Vec4T< T >::operator+= | ( | const Vec4T< T > & | rhs | ) |
Unary vector add.
Slightly more efficient because no temporary intermediate object.
Definition at line 604 of file Vec4Template.h.
const Vec4T< T > agx::Vec4T< T >::operator- |
Negation operator.
Returns the negative of the Vec4T.
Definition at line 662 of file Vec4Template.h.
const Vec4T< T > agx::Vec4T< T >::operator- | ( | const T & | rhs | ) | const |
Binary vector subtract.
Definition at line 646 of file Vec4Template.h.
const Vec4T< T > agx::Vec4T< T >::operator- | ( | const Vec4T< T > & | rhs | ) | const |
Binary vector subtract.
Definition at line 614 of file Vec4Template.h.
Vec4T< T > & agx::Vec4T< T >::operator-= | ( | const T & | rhs | ) |
Unary vector subtract.
Definition at line 652 of file Vec4Template.h.
Vec4T< T > & agx::Vec4T< T >::operator-= | ( | const Vec4T< T > & | rhs | ) |
Unary vector subtract.
Definition at line 620 of file Vec4Template.h.
const Vec4T< T > agx::Vec4T< T >::operator/ | ( | T | rhs | ) | const |
Divide by scalar.
Definition at line 581 of file Vec4Template.h.
Vec4T< T > & agx::Vec4T< T >::operator/= | ( | T | rhs | ) |
rhs
. Definition at line 587 of file Vec4Template.h.
bool agx::Vec4T< T >::operator== | ( | const Vec4T< T > & | v | ) | const |
Equality test.
Definition at line 352 of file Vec4Template.h.
T & agx::Vec4T< T >::operator[] | ( | size_t | i | ) |
Definition at line 472 of file Vec4Template.h.
const T & agx::Vec4T< T >::operator[] | ( | size_t | i | ) | const |
Definition at line 478 of file Vec4Template.h.
const Vec4T< T > agx::Vec4T< T >::operator| | ( | const Vec4T< T > & | rhs | ) | const |
Definition at line 555 of file Vec4Template.h.
T * agx::Vec4T< T >::ptr |
Definition at line 436 of file Vec4Template.h.
const T * agx::Vec4T< T >::ptr |
Definition at line 442 of file Vec4Template.h.
|
static |
min
..max
] Definition at line 714 of file Vec4Template.h.
References agx::max(), agx::min(), and agx::random().
|
static |
min
..max
] Definition at line 708 of file Vec4Template.h.
References agx::max(), agx::min(), and agx::random().
void agx::Vec4T< T >::set | ( | const Vec4T< T > & | rhs | ) |
Set the value of the vector with rhs
.
Definition at line 463 of file Vec4Template.h.
void agx::Vec4T< T >::set | ( | T | value | ) |
Set all elements of the vector with scalar value value
.
Definition at line 457 of file Vec4Template.h.
void agx::Vec4T< T >::set | ( | T | x, |
T | y, | ||
T | z, | ||
T | w | ||
) |
Set the elements of the vector.
Definition at line 448 of file Vec4Template.h.
T & agx::Vec4T< T >::w |
Definition at line 502 of file Vec4Template.h.
Referenced by agx::QuatT< T >::QuatT(), agxRender::Color::a(), agx::Matrix4x4T< T >::postMult(), agx::Matrix4x4T< T >::preMult(), and agx::QuatT< T >::set().
T agx::Vec4T< T >::w |
Definition at line 525 of file Vec4Template.h.
T & agx::Vec4T< T >::x |
Definition at line 484 of file Vec4Template.h.
Referenced by agx::QuatT< T >::QuatT(), agx::Matrix4x4T< T >::postMult(), agx::Matrix4x4T< T >::preMult(), agxRender::Color::r(), and agx::QuatT< T >::set().
T agx::Vec4T< T >::x |
Definition at line 508 of file Vec4Template.h.
T & agx::Vec4T< T >::y |
Definition at line 490 of file Vec4Template.h.
Referenced by agx::QuatT< T >::QuatT(), agxRender::Color::g(), agx::Matrix4x4T< T >::postMult(), agx::Matrix4x4T< T >::preMult(), and agx::QuatT< T >::set().
T agx::Vec4T< T >::y |
Definition at line 514 of file Vec4Template.h.
T & agx::Vec4T< T >::z |
Definition at line 496 of file Vec4Template.h.
Referenced by agx::QuatT< T >::QuatT(), agxRender::Color::b(), agx::Matrix4x4T< T >::postMult(), agx::Matrix4x4T< T >::preMult(), and agx::QuatT< T >::set().
T agx::Vec4T< T >::z |
Definition at line 519 of file Vec4Template.h.