HDK
|
#include <vec3d.h>
Public Types | |
typedef double | ScalarType |
Scalar element type and dimension. More... | |
Public Member Functions | |
GfVec3d ()=default | |
Default constructor does no initialization. More... | |
constexpr | GfVec3d (double value) |
Initialize all elements to a single value. More... | |
constexpr | GfVec3d (double s0, double s1, double s2) |
Initialize all elements with explicit arguments. More... | |
template<class Scl > | |
constexpr | GfVec3d (Scl const *p) |
Construct with pointer to values. More... | |
GfVec3d (class GfVec3f const &other) | |
Implicitly convert from GfVec3f. More... | |
GfVec3d (class GfVec3h const &other) | |
Implicitly convert from GfVec3h. More... | |
GfVec3d (class GfVec3i const &other) | |
Implicitly convert from GfVec3i. More... | |
GfVec3d & | Set (double s0, double s1, double s2) |
Set all elements with passed arguments. More... | |
GfVec3d & | Set (double const *a) |
Set all elements with a pointer to data. More... | |
double const * | data () const |
Direct data access. More... | |
double * | data () |
double const * | GetArray () const |
double const & | operator[] (size_t i) const |
Indexing. More... | |
double & | operator[] (size_t i) |
bool | operator== (GfVec3d const &other) const |
Equality comparison. More... | |
bool | operator!= (GfVec3d const &other) const |
GF_API bool | operator== (class GfVec3f const &other) const |
Equality comparison. More... | |
GF_API bool | operator== (class GfVec3h const &other) const |
Equality comparison. More... | |
GF_API bool | operator== (class GfVec3i const &other) const |
Equality comparison. More... | |
GfVec3d | operator- () const |
Create a vec with negated elements. More... | |
GfVec3d & | operator+= (GfVec3d const &other) |
Addition. More... | |
GfVec3d & | operator-= (GfVec3d const &other) |
Subtraction. More... | |
GfVec3d & | operator*= (double s) |
Multiplication by scalar. More... | |
GfVec3d | operator* (double s) const |
GfVec3d & | operator/= (double s) |
Division by scalar. More... | |
GfVec3d | operator/ (double s) const |
double | operator* (GfVec3d const &v) const |
See GfDot(). More... | |
GfVec3d | GetProjection (GfVec3d const &v) const |
GfVec3d | GetComplement (GfVec3d const &b) const |
double | GetLengthSq () const |
Squared length. More... | |
double | GetLength () const |
Length. More... | |
double | Normalize (double eps=GF_MIN_VECTOR_LENGTH) |
GfVec3d | GetNormalized (double eps=GF_MIN_VECTOR_LENGTH) const |
GF_API void | BuildOrthonormalFrame (GfVec3d *v1, GfVec3d *v2, double eps=GF_MIN_VECTOR_LENGTH) const |
Static Public Member Functions | |
static GfVec3d | XAxis () |
Create a unit vector along the X-axis. More... | |
static GfVec3d | YAxis () |
Create a unit vector along the Y-axis. More... | |
static GfVec3d | ZAxis () |
Create a unit vector along the Z-axis. More... | |
static GfVec3d | Axis (size_t i) |
static GF_API bool | OrthogonalizeBasis (GfVec3d *tx, GfVec3d *ty, GfVec3d *tz, const bool normalize, double eps=GF_MIN_ORTHO_TOLERANCE) |
Static Public Attributes | |
static const size_t | dimension = 3 |
Friends | |
size_t | hash_value (GfVec3d const &vec) |
Hash. More... | |
GfVec3d | operator+ (GfVec3d const &l, GfVec3d const &r) |
GfVec3d | operator- (GfVec3d const &l, GfVec3d const &r) |
GfVec3d | operator* (double s, GfVec3d const &v) |
Basic type for a vector of 3 double components.
Represents a vector of 3 components of type double
. It is intended to be fast and simple.
typedef double GfVec3d::ScalarType |
|
default |
Default constructor does no initialization.
|
inlineexplicit |
|
inline |
|
inlineexplicit |
|
inline |
|
inlinestatic |
GF_API void GfVec3d::BuildOrthonormalFrame | ( | GfVec3d * | v1, |
GfVec3d * | v2, | ||
double | eps = GF_MIN_VECTOR_LENGTH |
||
) | const |
Sets v1
and v2
to unit vectors such that v1, v2 and *this are mutually orthogonal. If the length L of *this is smaller than eps
, then v1 and v2 will have magnitude L/eps. As a result, the function delivers a continuous result as *this shrinks in length.
|
inline |
Returns the orthogonal complement of this->GetProjection(b)
. That is:
|
inline |
|
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 |
|
inline |
|
static |
Orthogonalize and optionally normalize a set of basis vectors. This uses an iterative method that is very stable even when the vectors are far from orthogonal (close to colinear). The number of iterations and thus the computation time does increase as the vectors become close to colinear, however. Returns a bool specifying whether the solution converged after a number of iterations. If it did not converge, the returned vectors will be as close as possible to orthogonal within the iteration limit. Colinear vectors will be unaltered, and the method will return false.
|
inline |
|
inline |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |