|
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 | |
Default constructor does no initialization. | |
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 |
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. | |
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.
typedef GfHalf ScalarType |
|
default |
Default constructor does no initialization.
|
inlineexplicitconstexpr |
|
inlinestatic |
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 |