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