![]() |
|
Basic type for a vector of 4 GfHalf components. More...
#include <vec4h.h>
Public Types | |
| typedef GfHalf | ScalarType |
| Scalar element type and dimension. | |
Public Member Functions | |
| GfVec4h ()=default | |
| GfVec4h value-initializes to zero and performs no default initialization, like float or double. | |
| constexpr | GfVec4h (GfHalf value) |
| Initialize all elements to a single value. | |
| constexpr | GfVec4h (GfHalf s0, GfHalf s1, GfHalf s2, GfHalf s3) |
| Initialize all elements with explicit arguments. | |
| template<class Scl > | |
| constexpr | GfVec4h (Scl const *p) |
| Construct with pointer to values. | |
| GfVec4h (class GfVec4d const &other) | |
| Construct from GfVec4d. | |
| GfVec4h (class GfVec4f const &other) | |
| Construct from GfVec4f. | |
| GfVec4h (class GfVec4i const &other) | |
| Implicitly convert from GfVec4i. | |
| GfVec4h & | Set (GfHalf s0, GfHalf s1, GfHalf s2, GfHalf s3) |
| Set all elements with passed arguments. | |
| GfVec4h & | Set (GfHalf const *a) |
| Set all elements with a pointer to data. | |
| GfHalf const * | data () const |
| Direct data access. | |
| GfHalf * | data () |
| GfHalf const * | GetArray () const |
| GfHalf const & | operator[] (size_t i) const |
| Indexing. | |
| GfHalf & | operator[] (size_t i) |
| bool | operator== (GfVec4h const &other) const |
| Equality comparison. | |
| bool | operator!= (GfVec4h const &other) const |
| GF_API bool | operator== (class GfVec4d const &other) const |
| Equality comparison. | |
| GF_API bool | operator== (class GfVec4f const &other) const |
| Equality comparison. | |
| GF_API bool | operator== (class GfVec4i const &other) const |
| Equality comparison. | |
| GfVec4h | operator- () const |
| Create a vec with negated elements. | |
| GfVec4h & | operator+= (GfVec4h const &other) |
| Addition. | |
| GfVec4h & | operator-= (GfVec4h const &other) |
| Subtraction. | |
| GfVec4h & | operator*= (double s) |
| Multiplication by scalar. | |
| GfVec4h | operator* (double s) const |
| GfVec4h & | operator/= (double s) |
| Division by scalar. | |
| GfVec4h | operator/ (double s) const |
| GfHalf | operator* (GfVec4h const &v) const |
| See GfDot(). | |
| GfVec4h | GetProjection (GfVec4h const &v) const |
Returns the projection of this onto v. | |
| GfVec4h | GetComplement (GfVec4h const &b) const |
Returns the orthogonal complement of this->GetProjection(b). | |
| GfHalf | GetLengthSq () const |
| Squared length. | |
| GfHalf | GetLength () const |
| Length. | |
| GfHalf | Normalize (GfHalf eps=0.001) |
| Normalizes the vector in place to unit length, returning the length before normalization. | |
| GfVec4h | GetNormalized (GfHalf eps=0.001) const |
Swizzles | |
Each accessor returns a new vector built from this one's components, in the order named. For example wzyx() returns GfVec4h(w, z, y, x). Every permutation of 2 to 4 of the 4 components is available. Repeated components ( The results are ordinary GfVecs, so all the usual operators, GfDot() and so on apply to them. They are values, not references into this vector, so they cannot be assigned through. | |
| constexpr GfVec2h | xy () const |
| constexpr GfVec2h | xz () const |
| constexpr GfVec2h | xw () const |
| constexpr GfVec2h | yx () const |
| constexpr GfVec2h | yz () const |
| constexpr GfVec2h | yw () const |
| constexpr GfVec2h | zx () const |
| constexpr GfVec2h | zy () const |
| constexpr GfVec2h | zw () const |
| constexpr GfVec2h | wx () const |
| constexpr GfVec2h | wy () const |
| constexpr GfVec2h | wz () const |
| constexpr GfVec3h | xyz () const |
| constexpr GfVec3h | xyw () const |
| constexpr GfVec3h | xzy () const |
| constexpr GfVec3h | xzw () const |
| constexpr GfVec3h | xwy () const |
| constexpr GfVec3h | xwz () const |
| constexpr GfVec3h | yxz () const |
| constexpr GfVec3h | yxw () const |
| constexpr GfVec3h | yzx () const |
| constexpr GfVec3h | yzw () const |
| constexpr GfVec3h | ywx () const |
| constexpr GfVec3h | ywz () const |
| constexpr GfVec3h | zxy () const |
| constexpr GfVec3h | zxw () const |
| constexpr GfVec3h | zyx () const |
| constexpr GfVec3h | zyw () const |
| constexpr GfVec3h | zwx () const |
| constexpr GfVec3h | zwy () const |
| constexpr GfVec3h | wxy () const |
| constexpr GfVec3h | wxz () const |
| constexpr GfVec3h | wyx () const |
| constexpr GfVec3h | wyz () const |
| constexpr GfVec3h | wzx () const |
| constexpr GfVec3h | wzy () const |
| constexpr GfVec4h | xyzw () const |
| constexpr GfVec4h | xywz () const |
| constexpr GfVec4h | xzyw () const |
| constexpr GfVec4h | xzwy () const |
| constexpr GfVec4h | xwyz () const |
| constexpr GfVec4h | xwzy () const |
| constexpr GfVec4h | yxzw () const |
| constexpr GfVec4h | yxwz () const |
| constexpr GfVec4h | yzxw () const |
| constexpr GfVec4h | yzwx () const |
| constexpr GfVec4h | ywxz () const |
| constexpr GfVec4h | ywzx () const |
| constexpr GfVec4h | zxyw () const |
| constexpr GfVec4h | zxwy () const |
| constexpr GfVec4h | zyxw () const |
| constexpr GfVec4h | zywx () const |
| constexpr GfVec4h | zwxy () const |
| constexpr GfVec4h | zwyx () const |
| constexpr GfVec4h | wxyz () const |
| constexpr GfVec4h | wxzy () const |
| constexpr GfVec4h | wyxz () const |
| constexpr GfVec4h | wyzx () const |
| constexpr GfVec4h | wzxy () const |
| constexpr GfVec4h | wzyx () const |
Static Public Member Functions | |
| static GfVec4h | XAxis () |
| Create a unit vector along the X-axis. | |
| static GfVec4h | YAxis () |
| Create a unit vector along the Y-axis. | |
| static GfVec4h | ZAxis () |
| Create a unit vector along the Z-axis. | |
| static GfVec4h | WAxis () |
| Create a unit vector along the W-axis. | |
| static GfVec4h | Axis (size_t i) |
| Create a unit vector along the i-th axis, zero-based. | |
Public Attributes | |
Vector Components | |
The vector's components, which are also its storage. These are public and directly readable and writable. The components are contiguous and in declaration order, so For multi-component access see the swizzle accessors below, which return a new vector by value. | |
| GfHalf | x |
| GfHalf | y |
| GfHalf | z |
| GfHalf | w |
Static Public Attributes | |
| static const size_t | dimension = 4 |
Friends | |
| size_t | hash_value (GfVec4h const &vec) |
| Hash. | |
| GfVec4h | operator+ (GfVec4h const &l, GfVec4h const &r) |
| GfVec4h | operator- (GfVec4h const &l, GfVec4h const &r) |
| GfVec4h | operator* (double s, GfVec4h const &v) |
Basic type for a vector of 4 GfHalf components.
Represents a vector of 4 components of type GfHalf. It is intended to be fast and simple.
|
default |
GfVec4h value-initializes to zero and performs no default initialization, like float or double.
|
inlineexplicitconstexpr |
|
inlinestatic |
|
inline |
Returns the orthogonal complement of this->GetProjection(b).
That is:
Normalizes the vector in place to unit length, returning the length before normalization.
If the length of the vector is smaller than eps, then the vector is set to vector/eps. The original length of the vector is returned. See also GfNormalize().
|
inline |
|
inline |
| GF_API bool operator== | ( | class GfVec4d const & | other | ) | const |
Equality comparison.
| GF_API bool operator== | ( | class GfVec4f const & | other | ) | const |
Equality comparison.
| GF_API bool operator== | ( | class GfVec4i const & | other | ) | const |
Equality comparison.
|
inline |
|
inline |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |