![]() |
|
Basic type for a vector of 4 float components. More...
#include <vec4f.h>
Public Types | |
| typedef float | ScalarType |
| Scalar element type and dimension. | |
Public Member Functions | |
| GfVec4f ()=default | |
| GfVec4f value-initializes to zero and performs no default initialization, like float or double. | |
| constexpr | GfVec4f (float value) |
| Initialize all elements to a single value. | |
| constexpr | GfVec4f (float s0, float s1, float s2, float s3) |
| Initialize all elements with explicit arguments. | |
| template<class Scl > | |
| constexpr | GfVec4f (Scl const *p) |
| Construct with pointer to values. | |
| GfVec4f (class GfVec4d const &other) | |
| Construct from GfVec4d. | |
| GfVec4f (class GfVec4h const &other) | |
| Implicitly convert from GfVec4h. | |
| GfVec4f (class GfVec4i const &other) | |
| Implicitly convert from GfVec4i. | |
| GfVec4f & | Set (float s0, float s1, float s2, float s3) |
| Set all elements with passed arguments. | |
| GfVec4f & | Set (float const *a) |
| Set all elements with a pointer to data. | |
| float const * | data () const |
| Direct data access. | |
| float * | data () |
| float const * | GetArray () const |
| float const & | operator[] (size_t i) const |
| Indexing. | |
| float & | operator[] (size_t i) |
| bool | operator== (GfVec4f const &other) const |
| Equality comparison. | |
| bool | operator!= (GfVec4f const &other) const |
| GF_API bool | operator== (class GfVec4d const &other) const |
| Equality comparison. | |
| GF_API bool | operator== (class GfVec4h const &other) const |
| Equality comparison. | |
| GF_API bool | operator== (class GfVec4i const &other) const |
| Equality comparison. | |
| GfVec4f | operator- () const |
| Create a vec with negated elements. | |
| GfVec4f & | operator+= (GfVec4f const &other) |
| Addition. | |
| GfVec4f & | operator-= (GfVec4f const &other) |
| Subtraction. | |
| GfVec4f & | operator*= (double s) |
| Multiplication by scalar. | |
| GfVec4f | operator* (double s) const |
| GfVec4f & | operator/= (double s) |
| Division by scalar. | |
| GfVec4f | operator/ (double s) const |
| float | operator* (GfVec4f const &v) const |
| See GfDot(). | |
| GfVec4f | GetProjection (GfVec4f const &v) const |
Returns the projection of this onto v. | |
| GfVec4f | GetComplement (GfVec4f const &b) const |
Returns the orthogonal complement of this->GetProjection(b). | |
| float | GetLengthSq () const |
| Squared length. | |
| float | GetLength () const |
| Length. | |
| float | Normalize (float eps=GF_MIN_VECTOR_LENGTH) |
| Normalizes the vector in place to unit length, returning the length before normalization. | |
| GfVec4f | GetNormalized (float eps=GF_MIN_VECTOR_LENGTH) const |
Swizzles | |
Each accessor returns a new vector built from this one's components, in the order named. For example wzyx() returns GfVec4f(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 GfVec2f | xy () const |
| constexpr GfVec2f | xz () const |
| constexpr GfVec2f | xw () const |
| constexpr GfVec2f | yx () const |
| constexpr GfVec2f | yz () const |
| constexpr GfVec2f | yw () const |
| constexpr GfVec2f | zx () const |
| constexpr GfVec2f | zy () const |
| constexpr GfVec2f | zw () const |
| constexpr GfVec2f | wx () const |
| constexpr GfVec2f | wy () const |
| constexpr GfVec2f | wz () const |
| constexpr GfVec3f | xyz () const |
| constexpr GfVec3f | xyw () const |
| constexpr GfVec3f | xzy () const |
| constexpr GfVec3f | xzw () const |
| constexpr GfVec3f | xwy () const |
| constexpr GfVec3f | xwz () const |
| constexpr GfVec3f | yxz () const |
| constexpr GfVec3f | yxw () const |
| constexpr GfVec3f | yzx () const |
| constexpr GfVec3f | yzw () const |
| constexpr GfVec3f | ywx () const |
| constexpr GfVec3f | ywz () const |
| constexpr GfVec3f | zxy () const |
| constexpr GfVec3f | zxw () const |
| constexpr GfVec3f | zyx () const |
| constexpr GfVec3f | zyw () const |
| constexpr GfVec3f | zwx () const |
| constexpr GfVec3f | zwy () const |
| constexpr GfVec3f | wxy () const |
| constexpr GfVec3f | wxz () const |
| constexpr GfVec3f | wyx () const |
| constexpr GfVec3f | wyz () const |
| constexpr GfVec3f | wzx () const |
| constexpr GfVec3f | wzy () const |
| constexpr GfVec4f | xyzw () const |
| constexpr GfVec4f | xywz () const |
| constexpr GfVec4f | xzyw () const |
| constexpr GfVec4f | xzwy () const |
| constexpr GfVec4f | xwyz () const |
| constexpr GfVec4f | xwzy () const |
| constexpr GfVec4f | yxzw () const |
| constexpr GfVec4f | yxwz () const |
| constexpr GfVec4f | yzxw () const |
| constexpr GfVec4f | yzwx () const |
| constexpr GfVec4f | ywxz () const |
| constexpr GfVec4f | ywzx () const |
| constexpr GfVec4f | zxyw () const |
| constexpr GfVec4f | zxwy () const |
| constexpr GfVec4f | zyxw () const |
| constexpr GfVec4f | zywx () const |
| constexpr GfVec4f | zwxy () const |
| constexpr GfVec4f | zwyx () const |
| constexpr GfVec4f | wxyz () const |
| constexpr GfVec4f | wxzy () const |
| constexpr GfVec4f | wyxz () const |
| constexpr GfVec4f | wyzx () const |
| constexpr GfVec4f | wzxy () const |
| constexpr GfVec4f | wzyx () const |
Static Public Member Functions | |
| static GfVec4f | XAxis () |
| Create a unit vector along the X-axis. | |
| static GfVec4f | YAxis () |
| Create a unit vector along the Y-axis. | |
| static GfVec4f | ZAxis () |
| Create a unit vector along the Z-axis. | |
| static GfVec4f | WAxis () |
| Create a unit vector along the W-axis. | |
| static GfVec4f | 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. | |
| float | x |
| float | y |
| float | z |
| float | w |
Static Public Attributes | |
| static const size_t | dimension = 4 |
Friends | |
| size_t | hash_value (GfVec4f const &vec) |
| Hash. | |
| GfVec4f | operator+ (GfVec4f const &l, GfVec4f const &r) |
| GfVec4f | operator- (GfVec4f const &l, GfVec4f const &r) |
| GfVec4f | operator* (double s, GfVec4f const &v) |
Basic type for a vector of 4 float components.
Represents a vector of 4 components of type float. It is intended to be fast and simple.
| float ScalarType |
|
default |
GfVec4f value-initializes to zero and performs no default initialization, like float or double.
|
inlineexplicitconstexpr |
|
inlineconstexpr |
|
inlineexplicitconstexpr |
|
inlinestatic |
|
inline |
Returns the orthogonal complement of this->GetProjection(b).
That is:
|
inline |
|
inline |
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 |
|
inline |
| GF_API bool operator== | ( | class GfVec4d const & | other | ) | const |
Equality comparison.
| GF_API bool operator== | ( | class GfVec4h const & | other | ) | const |
Equality comparison.
| GF_API bool operator== | ( | class GfVec4i const & | other | ) | const |
Equality comparison.
|
inline |
|
inline |
|
inline |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |