HDK
|
4D Vector class. More...
#include <UT_Vector4.h>
Public Types | |
typedef T | value_type |
Public Member Functions | |
constexpr SYS_FORCE_INLINE | UT_Vector4T ()=default |
constexpr SYS_FORCE_INLINE | UT_Vector4T (const UT_Vector4T< T > &that)=default |
constexpr SYS_FORCE_INLINE | UT_Vector4T (UT_Vector4T< T > &&that)=default |
constexpr SYS_FORCE_INLINE | UT_Vector4T (const T vx, const T vy, const T vz, const T vw=1.0f) |
constexpr SYS_FORCE_INLINE | UT_Vector4T (const fpreal32 v[]) noexcept |
constexpr SYS_FORCE_INLINE | UT_Vector4T (const fpreal64 v[]) noexcept |
constexpr SYS_FORCE_INLINE | UT_Vector4T (const int32 v[]) noexcept |
constexpr SYS_FORCE_INLINE | UT_Vector4T (const int64 v[]) noexcept |
SYS_FORCE_INLINE constexpr | UT_Vector4T (const UT_Vector2T< T > &v) noexcept |
constexpr | UT_Vector4T (const UT_Vector3T< T > &v, T w=1.f) noexcept |
template<typename S > | |
constexpr SYS_FORCE_INLINE | UT_Vector4T (const UT_Vector4T< S > &v) noexcept |
Our own type of any given value_type. More... | |
SYS_FORCE_INLINE UT_Vector4T< T > & | operator= (const UT_Vector4T< T > &that)=default |
SYS_FORCE_INLINE UT_Vector4T< T > & | operator= (UT_Vector4T< T > &&that)=default |
template<typename S > | |
SYS_FORCE_INLINE UT_Vector4T< T > & | operator= (const UT_Vector4T< S > &v) |
constexpr SYS_FORCE_INLINE const T * | data () const noexcept |
constexpr SYS_FORCE_INLINE T * | data () noexcept |
constexpr SYS_FORCE_INLINE const T & | operator[] (exint i) const noexcept |
constexpr SYS_FORCE_INLINE T & | operator[] (exint i) noexcept |
constexpr SYS_FORCE_INLINE UT_Vector4T & | operator+= (const UT_Vector4T &a) noexcept |
constexpr SYS_FORCE_INLINE UT_Vector4T & | operator-= (const UT_Vector4T &a) noexcept |
constexpr SYS_FORCE_INLINE UT_Vector4T & | operator*= (const T &a) noexcept |
constexpr SYS_FORCE_INLINE UT_Vector4T & | operator/= (const T &a) noexcept |
constexpr SYS_FORCE_INLINE UT_Vector4T & | operator*= (const UT_Vector4T &a) noexcept |
constexpr SYS_FORCE_INLINE void | negate () noexcept |
constexpr SYS_FORCE_INLINE T | length2 () const noexcept |
constexpr SYS_FORCE_INLINE T | length () const noexcept |
constexpr SYS_FORCE_INLINE T | distance2 (const UT_Vector4T &b) const noexcept |
constexpr SYS_FORCE_INLINE T | distance (const UT_Vector4T &b) const noexcept |
SYS_FORCE_INLINE UT_StorageMathFloat_t< T > | normalize () noexcept |
constexpr SYS_FORCE_INLINE bool | isZero () const noexcept |
constexpr SYS_FORCE_INLINE UT_Vector4T & | operator= (const T a) noexcept |
UT_Vector4T< T > & | operator= (const UT_Vector3T< T > &v) |
int | equalZero3 (T tol=0.00001f) const |
void | clampZero (T tol=0.00001f) |
void | clampZero3 (T tol=0.00001f) |
void | negate3 () |
void | multiplyComponents (const UT_Vector4T< T > &v) |
constexpr SYS_FORCE_INLINE bool | isFinite () const noexcept |
constexpr SYS_FORCE_INLINE bool | equalZero (const T tolerance=SYS_FTOLERANCE) const noexcept |
constexpr SYS_FORCE_INLINE bool | isEqual (const UT_Vector4T &b, const T tolerance=SYS_FTOLERANCE) const noexcept |
constexpr SYS_FORCE_INLINE T | maxComponent () const noexcept |
constexpr SYS_FORCE_INLINE T | minComponent () const noexcept |
constexpr SYS_FORCE_INLINE T | avgComponent () const noexcept |
int | isEqual (const UT_Vector3T< T > &vect, T tol=0.00001f) const |
constexpr SYS_FORCE_INLINE T | dot (const UT_Vector4T &b) const noexcept |
unsigned | hash () const |
Compute a hash. More... | |
void | assign (T xx=0.0f, T yy=0.0f, T zz=0.0f, T ww=1.0f) |
Set the values of the vector components. More... | |
void | assign (const T *v, int size=tuple_size) |
Set the values of the vector components. More... | |
void | save (std::ostream &os, int binary=0) const |
bool | load (UT_IStream &is) |
template<typename S > | |
void | rowVecMult (const UT_Matrix4T< S > &m) |
template<typename S > | |
void | colVecMult (const UT_Matrix4T< S > &m) |
template<typename S > | |
void | rowVecMult3 (const UT_Matrix4T< S > &m) |
template<typename S > | |
UT_Vector4T< T > & | operator*= (const UT_Matrix4T< S > &mat) |
template<typename S > | |
void | multiply3 (const UT_Matrix4T< S > &mat) |
template<typename S > | |
void | multiply3 (UT_Vector4T< T > &dest, const UT_Matrix4T< S > &mat) const |
int | findMinAbsAxis () const |
These allow you to find out what indices to use for different axes. More... | |
int | findMaxAbsAxis () const |
These allow you to find out what indices to use for different axes. More... | |
constexpr SYS_FORCE_INLINE T & | x () noexcept |
constexpr SYS_FORCE_INLINE T | x () const noexcept |
constexpr SYS_FORCE_INLINE T & | y () noexcept |
constexpr SYS_FORCE_INLINE T | y () const noexcept |
constexpr SYS_FORCE_INLINE T & | z () noexcept |
constexpr SYS_FORCE_INLINE T | z () const noexcept |
constexpr SYS_FORCE_INLINE T & | w () noexcept |
constexpr SYS_FORCE_INLINE T | w () const noexcept |
T & | operator() (unsigned i) |
T | operator() (unsigned i) const |
void | homogenize () |
Express the point in homogeneous coordinates or vice-versa. More... | |
void | dehomogenize () |
Express the point in homogeneous coordinates or vice-versa. More... | |
bool | save (UT_JSONWriter &w) const |
bool | save (UT_JSONValue &v) const |
bool | load (UT_JSONParser &p) |
Static Public Member Functions | |
static int | entries () |
Returns the vector size. More... | |
Public Attributes | |
T | vec [tuple_size] |
Static Public Attributes | |
static constexpr int | tuple_size = 4 |
Friends | |
constexpr bool | isZero (const UT_Vector4T &a) noexcept |
constexpr auto | dot (const UT_Vector4T &a, const UT_Vector4T &b) noexcept |
constexpr auto | length2 (const UT_Vector4T &a) noexcept |
constexpr auto | distance2 (const UT_Vector4T &a, const UT_Vector4T &b) noexcept |
constexpr bool | operator== (const UT_Vector4T &a, const UT_Vector4T &b) noexcept |
constexpr bool | operator!= (const UT_Vector4T &a, const UT_Vector4T &b) noexcept |
constexpr bool | operator< (const UT_Vector4T &a, const UT_Vector4T &b) noexcept |
constexpr bool | operator<= (const UT_Vector4T &a, const UT_Vector4T &b) noexcept |
constexpr bool | operator> (const UT_Vector4T &a, const UT_Vector4T &b) noexcept |
constexpr bool | operator>= (const UT_Vector4T &a, const UT_Vector4T &b) noexcept |
std::ostream & | operator<< (std::ostream &os, const UT_Vector4T< T > &v) |
I/O friends. More... | |
4D Vector class.
Definition at line 174 of file UT_Vector4.h.
typedef T UT_Vector4T< T >::value_type |
Definition at line 177 of file UT_Vector4.h.
|
default |
Default constructor. No data is initialized! Use it for extra speed.
|
default |
|
default |
|
inline |
Definition at line 187 of file UT_Vector4.h.
|
inlinenoexcept |
Definition at line 191 of file UT_Vector4.h.
|
inlinenoexcept |
Definition at line 194 of file UT_Vector4.h.
|
inlinenoexcept |
Definition at line 197 of file UT_Vector4.h.
|
inlinenoexcept |
Definition at line 200 of file UT_Vector4.h.
|
explicitnoexcept |
Definition at line 664 of file UT_Vector4.h.
|
explicitnoexcept |
Definition at line 672 of file UT_Vector4.h.
|
inlinenoexcept |
Our own type of any given value_type.
Definition at line 212 of file UT_Vector4.h.
|
inline |
Set the values of the vector components.
Definition at line 523 of file UT_Vector4.h.
|
inline |
Set the values of the vector components.
Definition at line 529 of file UT_Vector4.h.
|
inlinenoexcept |
Definition at line 385 of file UT_Vector4.h.
|
inline |
Definition at line 334 of file UT_Vector4.h.
|
inline |
Definition at line 342 of file UT_Vector4.h.
|
inline |
If you need a multiplication operator that left multiplies the vector by a matrix (M * v), use the following colVecMult() functions. If you'd rather not use operator*=() for right-multiplications (v * M), use the following rowVecMult() functions.
Definition at line 402 of file UT_Vector4.h.
|
inlinenoexcept |
Definition at line 224 of file UT_Vector4.h.
|
inlinenoexcept |
Definition at line 229 of file UT_Vector4.h.
|
inline |
Express the point in homogeneous coordinates or vice-versa.
Definition at line 545 of file UT_Vector4.h.
|
inlinenoexcept |
Definition at line 299 of file UT_Vector4.h.
|
inlinenoexcept |
Definition at line 294 of file UT_Vector4.h.
|
inlinenoexcept |
Definition at line 512 of file UT_Vector4.h.
|
inlinestatic |
Returns the vector size.
Definition at line 569 of file UT_Vector4.h.
|
inlinenoexcept |
Definition at line 365 of file UT_Vector4.h.
|
inline |
Definition at line 327 of file UT_Vector4.h.
|
inline |
These allow you to find out what indices to use for different axes.
Definition at line 461 of file UT_Vector4.h.
|
inline |
These allow you to find out what indices to use for different axes.
Definition at line 436 of file UT_Vector4.h.
|
inline |
Compute a hash.
Definition at line 518 of file UT_Vector4.h.
|
inline |
Express the point in homogeneous coordinates or vice-versa.
Definition at line 539 of file UT_Vector4.h.
|
inlinenoexcept |
Definition at line 370 of file UT_Vector4.h.
|
inline |
Definition at line 705 of file UT_Vector4.h.
|
inlinenoexcept |
Definition at line 360 of file UT_Vector4.h.
|
inlinenoexcept |
Definition at line 311 of file UT_Vector4.h.
|
inlinenoexcept |
Definition at line 289 of file UT_Vector4.h.
|
inlinenoexcept |
Definition at line 284 of file UT_Vector4.h.
bool UT_Vector4T< T >::load | ( | UT_IStream & | is | ) |
bool UT_Vector4T< T >::load | ( | UT_JSONParser & | p | ) |
Methods to serialize to a JSON stream. The vector is stored as an array of 4 reals.
|
inlinenoexcept |
Definition at line 375 of file UT_Vector4.h.
|
inlinenoexcept |
Definition at line 380 of file UT_Vector4.h.
|
inline |
Definition at line 427 of file UT_Vector4.h.
|
inline |
Definition at line 430 of file UT_Vector4.h.
|
inline |
Definition at line 352 of file UT_Vector4.h.
|
inlinenoexcept |
Definition at line 279 of file UT_Vector4.h.
|
inline |
Definition at line 349 of file UT_Vector4.h.
|
inlinenoexcept |
Definition at line 304 of file UT_Vector4.h.
|
inline |
Return the components of the vector. The () operator does NOT check for the boundary condition.
Definition at line 500 of file UT_Vector4.h.
|
inline |
Return the components of the vector. The () operator does NOT check for the boundary condition.
Definition at line 505 of file UT_Vector4.h.
|
inlinenoexcept |
Definition at line 260 of file UT_Vector4.h.
|
inlinenoexcept |
Definition at line 273 of file UT_Vector4.h.
|
inline |
Definition at line 423 of file UT_Vector4.h.
|
inlinenoexcept |
Definition at line 248 of file UT_Vector4.h.
|
inlinenoexcept |
Definition at line 254 of file UT_Vector4.h.
|
inlinenoexcept |
Definition at line 266 of file UT_Vector4.h.
|
default |
|
default |
|
inline |
Definition at line 220 of file UT_Vector4.h.
|
noexcept |
Definition at line 681 of file UT_Vector4.h.
UT_Vector4T<T>& UT_Vector4T< T >::operator= | ( | const UT_Vector3T< T > & | v | ) |
Assignment operator that creates a V4 from a V3 by adding a '1' element.
|
inlinenoexcept |
Definition at line 234 of file UT_Vector4.h.
|
inlinenoexcept |
Definition at line 241 of file UT_Vector4.h.
|
inline |
If you need a multiplication operator that left multiplies the vector by a matrix (M * v), use the following colVecMult() functions. If you'd rather not use operator*=() for right-multiplications (v * M), use the following rowVecMult() functions.
Definition at line 399 of file UT_Vector4.h.
|
inline |
This multiply will ignore the 4th component both in the vector an in the matrix. This helps when you want to avoid affecting the 'w' component. This in turns annihilates the translation components (row 4) in mat, so be careful.
Definition at line 412 of file UT_Vector4.h.
void UT_Vector4T< T >::save | ( | std::ostream & | os, |
int | binary = 0 |
||
) | const |
bool UT_Vector4T< T >::save | ( | UT_JSONWriter & | w | ) | const |
Methods to serialize to a JSON stream. The vector is stored as an array of 4 reals.
bool UT_Vector4T< T >::save | ( | UT_JSONValue & | v | ) | const |
Methods to serialize to a JSON stream. The vector is stored as an array of 4 reals.
|
inlinenoexcept |
Return the components of the vector. The () operator does NOT check for the boundary condition.
Definition at line 497 of file UT_Vector4.h.
|
inlinenoexcept |
Return the components of the vector. The () operator does NOT check for the boundary condition.
Definition at line 498 of file UT_Vector4.h.
|
inlinenoexcept |
Return the components of the vector. The () operator does NOT check for the boundary condition.
Definition at line 491 of file UT_Vector4.h.
|
inlinenoexcept |
Return the components of the vector. The () operator does NOT check for the boundary condition.
Definition at line 492 of file UT_Vector4.h.
|
inlinenoexcept |
Return the components of the vector. The () operator does NOT check for the boundary condition.
Definition at line 493 of file UT_Vector4.h.
|
inlinenoexcept |
Return the components of the vector. The () operator does NOT check for the boundary condition.
Definition at line 494 of file UT_Vector4.h.
|
inlinenoexcept |
Return the components of the vector. The () operator does NOT check for the boundary condition.
Definition at line 495 of file UT_Vector4.h.
|
inlinenoexcept |
Return the components of the vector. The () operator does NOT check for the boundary condition.
Definition at line 496 of file UT_Vector4.h.
|
friend |
Definition at line 601 of file UT_Vector4.h.
|
friend |
Definition at line 580 of file UT_Vector4.h.
|
friend |
Definition at line 575 of file UT_Vector4.h.
|
friend |
Definition at line 596 of file UT_Vector4.h.
|
friend |
Definition at line 611 of file UT_Vector4.h.
|
friend |
Lexicographic order comparison operators
Definition at line 618 of file UT_Vector4.h.
|
friend |
I/O friends.
Definition at line 641 of file UT_Vector4.h.
|
friend |
Lexicographic order comparison operators
Definition at line 623 of file UT_Vector4.h.
|
friend |
Definition at line 606 of file UT_Vector4.h.
|
friend |
Lexicographic order comparison operators
Definition at line 628 of file UT_Vector4.h.
|
friend |
Lexicographic order comparison operators
Definition at line 633 of file UT_Vector4.h.
|
static |
Definition at line 178 of file UT_Vector4.h.
T UT_Vector4T< T >::vec[tuple_size] |
Definition at line 571 of file UT_Vector4.h.