![]() |
AGX Dynamics 2.40.0.0
|
#include <Vec2Template.h>
Public Types | |
typedef T | Type |
Public Member Functions | |
Vec2T () | |
Default constructor. | |
Vec2T (const T v[2]) | |
Vec2T (const Vec2T ©)=default | |
Copy constructor. | |
template<typename T2 > | |
Vec2T (const Vec2T< T2 > ©) | |
Copy constructor for other types. | |
Vec2T (T r) | |
Vec2T (T x, T y) | |
void | clamp (const Vec2T &min, const Vec2T &max) |
Clamp a vector between a lower and upper bound (per component). | |
Real | distance (const Vec2T &v2) const |
Distance to another vector. | |
Real | distance2 (const Vec2T &v2) const |
Squared distance to another vector. | |
Real | distance2 (const Vec2T &v2) const |
Real | distance2 (const Vec2T &v2) const |
Real | distance2 (const Vec2T &v2) const |
Real | distance2 (const Vec2T &v2) const |
bool | equalsZero () const |
bool | isFinite () const |
bool | isNaN () const |
bool | isValid () const |
Real | length () const |
Length of the vector = sqrt( vec . | |
Real | length2 () const |
Length squared of the vector = vec . | |
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 Vec2T &v) const |
In-equality test. | |
T | operator* (const Vec2T &rhs) const |
Dot product. | |
const Vec2T | operator* (T rhs) const |
Multiply by scalar. | |
Vec2T & | operator*= (T rhs) |
Unary multiply by scalar. | |
const Vec2T | operator+ (const T &rhs) const |
Binary vector add. | |
const Vec2T | operator+ (const Vec2T &rhs) const |
Binary vector add. | |
Vec2T & | operator+= (const T &rhs) |
Unary vector add. | |
Vec2T & | operator+= (const Vec2T &rhs) |
Unary vector add. | |
const Vec2T | operator- () const |
Negation operator. | |
const Vec2T | operator- (const T &rhs) const |
Binary vector subtract. | |
const Vec2T | operator- (const Vec2T &rhs) const |
Binary vector subtract. | |
Vec2T & | operator-= (const T &rhs) |
Unary vector subtract. | |
Vec2T & | operator-= (const Vec2T &rhs) |
Unary vector subtract. | |
const Vec2T | operator/ (T rhs) const |
Divide by scalar. | |
Vec2T & | operator/= (T rhs) |
Unary divide by scalar. | |
bool | operator== (const Vec2T &v) const |
Equality test. | |
T & | operator[] (size_t i) |
const T & | operator[] (size_t i) const |
const Vec2T | operator| (const Vec2T &rhs) const |
Cross product. | |
T * | ptr () |
Return a pointer to the data vector. | |
const T * | ptr () const |
Return a const pointer to the data vector. | |
void | set (const Vec2T &rhs) |
void | set (T value) |
void | set (T x, T y) |
T & | x () |
T | x () const |
T & | y () |
T | y () const |
Static Public Member Functions | |
static Vec2T | componentMax (const Vec2T &v1, const Vec2T &v2) |
Creates a new vector where each component is the maximum of this and the other vector. | |
static Vec2T | componentMin (const Vec2T &v1, const Vec2T &v2) |
Creates a new vector where each component is the minimum of this and the other vector. | |
static Vec2T | div (const Vec2T &lhs, const Vec2T &rhs) |
static Vec2T | mul (const Vec2T &lhs, const Vec2T &rhs) |
Element-wise-multiplication. | |
static Vec2T | random (const Vec2T &min, const Vec2T &max) |
static Vec2T | random (T min, T max) |
Definition at line 30 of file Vec2Template.h.
typedef T agx::Vec2T< T >::Type |
Definition at line 33 of file Vec2Template.h.
|
default |
Copy constructor.
|
inlineexplicit |
Copy constructor for other types.
Definition at line 42 of file Vec2Template.h.
|
inline |
Default constructor.
Definition at line 52 of file Vec2Template.h.
Referenced by agx::Vec2T< T >::componentMax(), agx::Vec2T< T >::componentMin(), agx::Vec2T< T >::div(), agx::Vec2T< T >::mul(), agx::Vec2T< T >::operator*(), agx::Vec2T< T >::operator+(), agx::Vec2T< T >::operator-(), agx::Vec2T< T >::operator/(), and agx::Vec2T< T >::operator|().
|
inlineexplicit |
Definition at line 57 of file Vec2Template.h.
|
inline |
Definition at line 61 of file Vec2Template.h.
References agx::Vec2T< T >::x(), and agx::Vec2T< T >::y().
|
inlineexplicit |
Definition at line 66 of file Vec2Template.h.
|
inline |
Clamp a vector between a lower and upper bound (per component).
Definition at line 156 of file Vec2Template.h.
References agx::clamp(), agx::max(), and agx::min().
Referenced by agx::clamp().
|
inlinestatic |
Creates a new vector where each component is the maximum of this and the other vector.
Definition at line 98 of file Vec2Template.h.
References agx::Vec2T< T >::Vec2T().
|
inlinestatic |
Creates a new vector where each component is the minimum of this and the other vector.
Definition at line 91 of file Vec2Template.h.
References agx::Vec2T< T >::Vec2T().
|
inline |
Distance to another vector.
Definition at line 367 of file Vec2Template.h.
References agx::Vec2T< T >::distance2().
Real agx::Vec2T< T >::distance2 | ( | const Vec2T< T > & | v2 | ) | const |
Squared distance to another vector.
Definition at line 427 of file Vec2Template.h.
References agx::Vec2T< T >::length2().
Referenced by agx::Vec2T< T >::distance().
Real agx::Vec2T< UInt8 >::distance2 | ( | const Vec2T< T > & | v2 | ) | const |
Definition at line 435 of file Vec2Template.h.
References agx::Vec2T< T >::length2().
Real agx::Vec2T< UInt16 >::distance2 | ( | const Vec2T< T > & | v2 | ) | const |
Definition at line 445 of file Vec2Template.h.
References agx::Vec2T< T >::length2().
Real agx::Vec2T< UInt32 >::distance2 | ( | const Vec2T< T > & | v2 | ) | const |
Definition at line 454 of file Vec2Template.h.
References agx::Vec2T< T >::length2().
Real agx::Vec2T< UInt64 >::distance2 | ( | const Vec2T< T > & | v2 | ) | const |
Definition at line 464 of file Vec2Template.h.
References agx::Vec2T< T >::length2().
|
inlinestatic |
Definition at line 288 of file Vec2Template.h.
References agx::Vec2T< T >::Vec2T().
|
inline |
Definition at line 166 of file Vec2Template.h.
References agx::equalsZero().
|
inline |
Definition at line 230 of file Vec2Template.h.
References agx::isFinite().
|
inline |
Definition at line 226 of file Vec2Template.h.
References agx::isNaN().
Referenced by agx::Vec2T< T >::isValid().
|
inline |
Definition at line 222 of file Vec2Template.h.
References agx::Vec2T< T >::isNaN().
|
inline |
Length of the vector = sqrt( vec .
vec )
Definition at line 354 of file Vec2Template.h.
Referenced by agx::Vec2T< T >::normalize().
|
inline |
Length squared of the vector = vec .
vec
Definition at line 359 of file Vec2Template.h.
Referenced by agx::Vec2T< T >::distance2().
|
inline |
Definition at line 113 of file Vec2Template.h.
|
inline |
Definition at line 138 of file Vec2Template.h.
References agx::absolute().
|
inline |
Definition at line 105 of file Vec2Template.h.
|
inline |
Definition at line 121 of file Vec2Template.h.
References agx::absolute().
|
inlinestatic |
Element-wise-multiplication.
Definition at line 282 of file Vec2Template.h.
References agx::Vec2T< T >::Vec2T().
|
inline |
Normalize the vector so that it has length unity.
Returns the previous length of the vector.
Definition at line 376 of file Vec2Template.h.
References agx::Vec2T< T >::length().
|
inline |
In-equality test.
Definition at line 84 of file Vec2Template.h.
|
inline |
Dot product.
Definition at line 236 of file Vec2Template.h.
|
inline |
Multiply by scalar.
Definition at line 256 of file Vec2Template.h.
References agx::Vec2T< T >::Vec2T().
|
inline |
Unary multiply by scalar.
Definition at line 262 of file Vec2Template.h.
|
inline |
Binary vector add.
Definition at line 322 of file Vec2Template.h.
References agx::Vec2T< T >::Vec2T().
|
inline |
Binary vector add.
Definition at line 295 of file Vec2Template.h.
References agx::Vec2T< T >::Vec2T().
|
inline |
Unary vector add.
Slightly more efficient because no temporary intermediate object.
Definition at line 329 of file Vec2Template.h.
|
inline |
Unary vector add.
Slightly more efficient because no temporary intermediate object.
Definition at line 302 of file Vec2Template.h.
|
inline |
Negation operator.
Returns the negative of the Vec2T.
Definition at line 349 of file Vec2Template.h.
References agx::Vec2T< T >::Vec2T().
|
inline |
Binary vector subtract.
Definition at line 336 of file Vec2Template.h.
References agx::Vec2T< T >::Vec2T().
|
inline |
Binary vector subtract.
Definition at line 309 of file Vec2Template.h.
References agx::Vec2T< T >::Vec2T().
|
inline |
Unary vector subtract.
Definition at line 341 of file Vec2Template.h.
|
inline |
Unary vector subtract.
Definition at line 314 of file Vec2Template.h.
|
inline |
Divide by scalar.
Definition at line 269 of file Vec2Template.h.
References agx::Vec2T< T >::Vec2T().
|
inline |
Unary divide by scalar.
Definition at line 274 of file Vec2Template.h.
|
inline |
Equality test.
Definition at line 77 of file Vec2Template.h.
|
inline |
Definition at line 201 of file Vec2Template.h.
|
inline |
Definition at line 204 of file Vec2Template.h.
|
inline |
Cross product.
Element-wise-multiplication
Definition at line 250 of file Vec2Template.h.
References agx::Vec2T< T >::Vec2T().
|
inline |
Return a pointer to the data vector.
Definition at line 175 of file Vec2Template.h.
|
inline |
Return a const pointer to the data vector.
Definition at line 182 of file Vec2Template.h.
|
static |
Definition at line 397 of file Vec2Template.h.
References agx::max(), agx::min(), and agx::random().
|
static |
Definition at line 391 of file Vec2Template.h.
References agx::max(), agx::min(), and agx::random().
|
inline |
Definition at line 195 of file Vec2Template.h.
|
inline |
Definition at line 191 of file Vec2Template.h.
|
inline |
Definition at line 186 of file Vec2Template.h.
References agx::Vec2T< T >::x(), and agx::Vec2T< T >::y().
|
inline |
Definition at line 208 of file Vec2Template.h.
Referenced by agx::Vec2T< T >::Vec2T(), and agx::Vec2T< T >::set().
|
inline |
Definition at line 215 of file Vec2Template.h.
|
inline |
Definition at line 211 of file Vec2Template.h.
Referenced by agx::Vec2T< T >::Vec2T(), and agx::Vec2T< T >::set().
|
inline |
Definition at line 218 of file Vec2Template.h.