HDK
|
#include <vec2f.h>
Public Types | |
typedef float | ScalarType |
Scalar element type and dimension. More... | |
Public Member Functions | |
GfVec2f ()=default | |
Default constructor does no initialization. More... | |
constexpr | GfVec2f (float value) |
Initialize all elements to a single value. More... | |
constexpr | GfVec2f (float s0, float s1) |
Initialize all elements with explicit arguments. More... | |
template<class Scl > | |
constexpr | GfVec2f (Scl const *p) |
Construct with pointer to values. More... | |
GfVec2f (class GfVec2d const &other) | |
Construct from GfVec2d. More... | |
GfVec2f (class GfVec2h const &other) | |
Implicitly convert from GfVec2h. More... | |
GfVec2f (class GfVec2i const &other) | |
Implicitly convert from GfVec2i. More... | |
GfVec2f & | Set (float s0, float s1) |
Set all elements with passed arguments. More... | |
GfVec2f & | Set (float const *a) |
Set all elements with a pointer to data. More... | |
float const * | data () const |
Direct data access. More... | |
float * | data () |
float const * | GetArray () const |
float const & | operator[] (size_t i) const |
Indexing. More... | |
float & | operator[] (size_t i) |
bool | operator== (GfVec2f const &other) const |
Equality comparison. More... | |
bool | operator!= (GfVec2f const &other) const |
GF_API bool | operator== (class GfVec2d const &other) const |
Equality comparison. More... | |
GF_API bool | operator== (class GfVec2h const &other) const |
Equality comparison. More... | |
GF_API bool | operator== (class GfVec2i const &other) const |
Equality comparison. More... | |
GfVec2f | operator- () const |
Create a vec with negated elements. More... | |
GfVec2f & | operator+= (GfVec2f const &other) |
Addition. More... | |
GfVec2f & | operator-= (GfVec2f const &other) |
Subtraction. More... | |
GfVec2f & | operator*= (double s) |
Multiplication by scalar. More... | |
GfVec2f | operator* (double s) const |
GfVec2f & | operator/= (double s) |
Division by scalar. More... | |
GfVec2f | operator/ (double s) const |
float | operator* (GfVec2f const &v) const |
See GfDot(). More... | |
GfVec2f | GetProjection (GfVec2f const &v) const |
GfVec2f | GetComplement (GfVec2f const &b) const |
float | GetLengthSq () const |
Squared length. More... | |
float | GetLength () const |
Length. More... | |
float | Normalize (float eps=GF_MIN_VECTOR_LENGTH) |
GfVec2f | GetNormalized (float eps=GF_MIN_VECTOR_LENGTH) const |
Static Public Member Functions | |
static GfVec2f | XAxis () |
Create a unit vector along the X-axis. More... | |
static GfVec2f | YAxis () |
Create a unit vector along the Y-axis. More... | |
static GfVec2f | Axis (size_t i) |
Static Public Attributes | |
static const size_t | dimension = 2 |
Friends | |
size_t | hash_value (GfVec2f const &vec) |
Hash. More... | |
GfVec2f | operator+ (GfVec2f const &l, GfVec2f const &r) |
GfVec2f | operator- (GfVec2f const &l, GfVec2f const &r) |
GfVec2f | operator* (double s, GfVec2f const &v) |
Basic type for a vector of 2 float components.
Represents a vector of 2 components of type float
. It is intended to be fast and simple.
typedef float GfVec2f::ScalarType |
|
default |
Default constructor does no initialization.
|
inlineexplicit |
|
inlineexplicit |
|
inlineexplicit |
|
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 |
|
inline |
|
inline |
|
inline |
|
inlinestatic |
|
inlinestatic |