|
HDK
|
#include <ImathVec.h>
Public Types | |
| typedef T | BaseType |
Public Member Functions | |
| IMATH_HOSTDEVICE IMATH_CONSTEXPR14 T & | operator[] (int i) IMATH_NOEXCEPT |
| IMATH_HOSTDEVICE constexpr const T & | operator[] (int i) const IMATH_NOEXCEPT |
Constructors and Assignment | |
| IMATH_HOSTDEVICE | Vec4 () IMATH_NOEXCEPT |
| Uninitialized by default. More... | |
| IMATH_HOSTDEVICE constexpr | Vec4 (T a) IMATH_NOEXCEPT |
Initialize to a scalar (a,a,a,a) More... | |
| IMATH_HOSTDEVICE constexpr | Vec4 (T a, T b, T c, T d) IMATH_NOEXCEPT |
Initialize to given elements (a,b,c,d) More... | |
| IMATH_HOSTDEVICE constexpr | Vec4 (const Vec4 &v) IMATH_NOEXCEPT |
| Copy constructor. More... | |
| template<class S > | |
| IMATH_HOSTDEVICE constexpr | Vec4 (const Vec4< S > &v) IMATH_NOEXCEPT |
| Construct from Vec4 of another base type. More... | |
| template<class S > | |
| IMATH_HOSTDEVICE constexpr | Vec4 (const Vec3< S > &v) IMATH_NOEXCEPT |
| Vec3 to Vec4 conversion, sets w to 1. More... | |
| IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Vec4 & | operator= (const Vec4 &v) IMATH_NOEXCEPT |
| Assignment. More... | |
| ~Vec4 () IMATH_NOEXCEPT=default | |
| Destructor. More... | |
Interoperability with other vector types | |
| template<typename V , IMATH_ENABLE_IF(has_xyzw< V, T >::value) > | |
| IMATH_HOSTDEVICE constexpr | Vec4 (const V &v) IMATH_NOEXCEPT |
| template<typename V , IMATH_ENABLE_IF(has_subscript< V, T, 4 >::value &&!has_xyzw< V, T >::value) > | |
| IMATH_HOSTDEVICE | Vec4 (const V &v) |
| template<typename V , IMATH_ENABLE_IF(has_xyzw< V, T >::value) > | |
| IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Vec4 & | operator= (const V &v) IMATH_NOEXCEPT |
| template<typename V , IMATH_ENABLE_IF(has_subscript< V, T, 4 >::value &&!has_xyzw< V, T >::value) > | |
| IMATH_HOSTDEVICE const Vec4 & | operator= (const V &v) |
Compatibility with Sb | |
| template<class S > | |
| IMATH_HOSTDEVICE void | setValue (S a, S b, S c, S d) IMATH_NOEXCEPT |
| Set the value. More... | |
| template<class S > | |
| IMATH_HOSTDEVICE void | setValue (const Vec4< S > &v) IMATH_NOEXCEPT |
| Set the value. More... | |
| template<class S > | |
| IMATH_HOSTDEVICE void | getValue (S &a, S &b, S &c, S &d) const IMATH_NOEXCEPT |
Return the value in a and b More... | |
| template<class S > | |
| IMATH_HOSTDEVICE void | getValue (Vec4< S > &v) const IMATH_NOEXCEPT |
Return the value in v More... | |
| IMATH_HOSTDEVICE T * | getValue () IMATH_NOEXCEPT |
| Return a raw pointer to the array of values. More... | |
| IMATH_HOSTDEVICE const T * | getValue () const IMATH_NOEXCEPT |
| Return a raw pointer to the array of values. More... | |
Arithmetic and Comparison | |
| template<class S > | |
| IMATH_HOSTDEVICE constexpr bool | operator== (const Vec4< S > &v) const IMATH_NOEXCEPT |
| Equality. More... | |
| template<class S > | |
| IMATH_HOSTDEVICE constexpr bool | operator!= (const Vec4< S > &v) const IMATH_NOEXCEPT |
| Inequality. More... | |
| IMATH_HOSTDEVICE IMATH_CONSTEXPR14 bool | equalWithAbsError (const Vec4< T > &v, T e) const IMATH_NOEXCEPT |
| IMATH_HOSTDEVICE IMATH_CONSTEXPR14 bool | equalWithRelError (const Vec4< T > &v, T e) const IMATH_NOEXCEPT |
| IMATH_HOSTDEVICE constexpr T | dot (const Vec4 &v) const IMATH_NOEXCEPT |
| Dot product. More... | |
| IMATH_HOSTDEVICE constexpr T | operator^ (const Vec4 &v) const IMATH_NOEXCEPT |
| Dot product. More... | |
| IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Vec4 & | operator+= (const Vec4 &v) IMATH_NOEXCEPT |
| Component-wise addition. More... | |
| IMATH_HOSTDEVICE constexpr Vec4 | operator+ (const Vec4 &v) const IMATH_NOEXCEPT |
| Component-wise addition. More... | |
| IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Vec4 & | operator-= (const Vec4 &v) IMATH_NOEXCEPT |
| Component-wise subtraction. More... | |
| IMATH_HOSTDEVICE constexpr Vec4 | operator- (const Vec4 &v) const IMATH_NOEXCEPT |
| Component-wise subtraction. More... | |
| IMATH_HOSTDEVICE constexpr Vec4 | operator- () const IMATH_NOEXCEPT |
| Component-wise multiplication by -1. More... | |
| IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Vec4 & | negate () IMATH_NOEXCEPT |
| Component-wise multiplication by -1. More... | |
| IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Vec4 & | operator*= (const Vec4 &v) IMATH_NOEXCEPT |
| Component-wise multiplication. More... | |
| IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Vec4 & | operator*= (T a) IMATH_NOEXCEPT |
| Component-wise multiplication. More... | |
| IMATH_HOSTDEVICE constexpr Vec4 | operator* (const Vec4 &v) const IMATH_NOEXCEPT |
| Component-wise multiplication. More... | |
| IMATH_HOSTDEVICE constexpr Vec4 | operator* (T a) const IMATH_NOEXCEPT |
| Component-wise multiplication. More... | |
| IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Vec4 & | operator/= (const Vec4 &v) IMATH_NOEXCEPT |
| Component-wise division. More... | |
| IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Vec4 & | operator/= (T a) IMATH_NOEXCEPT |
| Component-wise division. More... | |
| IMATH_HOSTDEVICE constexpr Vec4 | operator/ (const Vec4 &v) const IMATH_NOEXCEPT |
| Component-wise division. More... | |
| IMATH_HOSTDEVICE constexpr Vec4 | operator/ (T a) const IMATH_NOEXCEPT |
| Component-wise division. More... | |
Query and Manipulation | |
| IMATH_HOSTDEVICE T | length () const IMATH_NOEXCEPT |
| Return the Euclidean norm. More... | |
| IMATH_HOSTDEVICE constexpr T | length2 () const IMATH_NOEXCEPT |
| IMATH_HOSTDEVICE const Vec4 & | normalize () IMATH_NOEXCEPT |
| Normalize in place. If length()==0, return a null vector. More... | |
| const Vec4 & | normalizeExc () |
| Normalize in place. If length()==0, throw an exception. More... | |
| IMATH_HOSTDEVICE const Vec4 & | normalizeNonNull () IMATH_NOEXCEPT |
| IMATH_HOSTDEVICE Vec4< T > | normalized () const IMATH_NOEXCEPT |
| Return a normalized vector. Does not modify *this. More... | |
| Vec4< T > | normalizedExc () const |
| IMATH_HOSTDEVICE Vec4< T > | normalizedNonNull () const IMATH_NOEXCEPT |
Static Public Member Functions | |
| IMATH_HOSTDEVICE static constexpr unsigned int | dimensions () IMATH_NOEXCEPT |
| Return the number of dimensions, i.e. 4. More... | |
Numeric Limits | |
| IMATH_HOSTDEVICE static constexpr T | baseTypeLowest () IMATH_NOEXCEPT |
| Largest possible negative value. More... | |
| IMATH_HOSTDEVICE static constexpr T | baseTypeMax () IMATH_NOEXCEPT |
| Largest possible positive value. More... | |
| IMATH_HOSTDEVICE static constexpr T | baseTypeSmallest () IMATH_NOEXCEPT |
| Smallest possible positive value. More... | |
| IMATH_HOSTDEVICE static constexpr T | baseTypeEpsilon () IMATH_NOEXCEPT |
| Smallest possible e for which 1+e != 1. More... | |
Public Attributes | |
Direct access to elements | |
| T | x |
| T | y |
| T | z |
| T | w |
The base type: In templates that accept a parameter V, you can refer to T as V::BaseType
Definition at line 999 of file ImathVec.h.
|
inline |
Uninitialized by default.
Definition at line 2189 of file ImathVec.h.
|
inlineexplicit |
Initialize to a scalar (a,a,a,a)
Definition at line 2195 of file ImathVec.h.
Initialize to given elements (a,b,c,d)
Definition at line 2202 of file ImathVec.h.
Copy constructor.
Definition at line 2210 of file ImathVec.h.
|
inline |
Construct from Vec4 of another base type.
Definition at line 2219 of file ImathVec.h.
|
inlineexplicit |
Vec3 to Vec4 conversion, sets w to 1.
Definition at line 2239 of file ImathVec.h.
|
inlineexplicit |
Definition at line 772 of file ImathVec.h.
|
inlineexplicit |
Definition at line 780 of file ImathVec.h.
|
inlinestatic |
Smallest possible e for which 1+e != 1.
Definition at line 984 of file ImathVec.h.
|
inlinestatic |
Largest possible negative value.
Definition at line 966 of file ImathVec.h.
|
inlinestatic |
Largest possible positive value.
Definition at line 972 of file ImathVec.h.
|
inlinestatic |
Smallest possible positive value.
Definition at line 978 of file ImathVec.h.
|
inlinestatic |
Return the number of dimensions, i.e. 4.
Definition at line 992 of file ImathVec.h.
Dot product.
Definition at line 2344 of file ImathVec.h.
|
inline |
Compare two vectors and test if they are "approximately equal":
v are the same with an absolute error of no more than e, i.e., for all i: abs (this[i] - v[i]) <= e
Definition at line 2322 of file ImathVec.h.
|
inline |
Compare two vectors and test if they are "approximately equal":
v are the same with a relative error of no more than e, i.e., for all i: abs (this[i] - v[i]) <= e * abs (this[i])
Definition at line 2333 of file ImathVec.h.
|
inline |
Return the value in a and b
Definition at line 2271 of file ImathVec.h.
|
inline |
Return the value in v
Definition at line 2282 of file ImathVec.h.
|
inline |
Return a raw pointer to the array of values.
Definition at line 2292 of file ImathVec.h.
|
inline |
Return a raw pointer to the array of values.
Definition at line 2299 of file ImathVec.h.
Return the Euclidean norm.
Definition at line 2518 of file ImathVec.h.
|
inline |
Return the square of the Euclidean norm, i.e. the dot product with itself.
Definition at line 2530 of file ImathVec.h.
|
inline |
Component-wise multiplication by -1.
Definition at line 2401 of file ImathVec.h.
|
inline |
Normalize in place. If length()==0, return a null vector.
Definition at line 2537 of file ImathVec.h.
|
inline |
Return a normalized vector. Does not modify *this.
Definition at line 2588 of file ImathVec.h.
Return a normalized vector. Does not modify *this. Throw an exception if length()==0.
Definition at line 2599 of file ImathVec.h.
|
inline |
Return a normalized vector. Does not modify *this, and does not check for length()==0. Slightly faster than the other normalization routines, but if v.length() is 0.0, the result is undefined.
Definition at line 2611 of file ImathVec.h.
Normalize in place. If length()==0, throw an exception.
Definition at line 2560 of file ImathVec.h.
|
inline |
Normalize without any checks for length()==0. Slightly faster than the other normalization routines, but if v.length() is 0.0, the result is undefined.
Definition at line 2576 of file ImathVec.h.
|
inline |
Inequality.
Definition at line 2315 of file ImathVec.h.
|
inline |
Component-wise multiplication.
Definition at line 2434 of file ImathVec.h.
Component-wise multiplication.
Definition at line 2441 of file ImathVec.h.
|
inline |
Component-wise multiplication.
Definition at line 2412 of file ImathVec.h.
|
inline |
Component-wise multiplication.
Definition at line 2423 of file ImathVec.h.
|
inline |
Component-wise addition.
Definition at line 2369 of file ImathVec.h.
|
inline |
Component-wise addition.
Definition at line 2358 of file ImathVec.h.
|
inline |
Component-wise subtraction.
Definition at line 2387 of file ImathVec.h.
|
inline |
Component-wise multiplication by -1.
Definition at line 2394 of file ImathVec.h.
|
inline |
Component-wise subtraction.
Definition at line 2376 of file ImathVec.h.
|
inline |
Component-wise division.
Definition at line 2470 of file ImathVec.h.
Component-wise division.
Definition at line 2477 of file ImathVec.h.
|
inline |
Component-wise division.
Definition at line 2448 of file ImathVec.h.
|
inline |
Component-wise division.
Definition at line 2459 of file ImathVec.h.
|
inline |
Assignment.
Definition at line 2228 of file ImathVec.h.
|
inline |
Definition at line 786 of file ImathVec.h.
|
inline |
Definition at line 799 of file ImathVec.h.
|
inline |
Equality.
Definition at line 2307 of file ImathVec.h.
|
inline |
Element access by index.
NB: This method of access uses dynamic array accesses which can prevent compiler optimizations and force temporaries to be stored to the stack and other missed vectorization opportunities. Use of direct access to x, y, z, w when possible should be preferred.
Definition at line 2166 of file ImathVec.h.
|
inline |
Element access by index.
NB: This method of access uses dynamic array accesses which can prevent compiler optimizations and force temporaries to be stored to the stack and other missed vectorization opportunities. Use of direct access to x, y, z, w when possible should be preferred.
Definition at line 2173 of file ImathVec.h.
|
inline |
Dot product.
Definition at line 2351 of file ImathVec.h.
|
inline |
Set the value.
Definition at line 2249 of file ImathVec.h.
|
inline |
Set the value.
Definition at line 2260 of file ImathVec.h.