HDK
|
#include <vec3f.h>
Public Types | |
typedef float | ScalarType |
Scalar element type and dimension. More... | |
Static Public Member Functions | |
static GfVec3f | XAxis () |
Create a unit vector along the X-axis. More... | |
static GfVec3f | YAxis () |
Create a unit vector along the Y-axis. More... | |
static GfVec3f | ZAxis () |
Create a unit vector along the Z-axis. More... | |
static GfVec3f | Axis (size_t i) |
static GF_API bool | OrthogonalizeBasis (GfVec3f *tx, GfVec3f *ty, GfVec3f *tz, const bool normalize, double eps=GF_MIN_ORTHO_TOLERANCE) |
Static Public Attributes | |
static const size_t | dimension = 3 |
Friends | |
size_t | hash_value (GfVec3f const &vec) |
Hash. More... | |
GfVec3f | operator+ (GfVec3f const &l, GfVec3f const &r) |
GfVec3f | operator- (GfVec3f const &l, GfVec3f const &r) |
GfVec3f | operator* (double s, GfVec3f const &v) |
Basic type for a vector of 3 float components.
Represents a vector of 3 components of type float
. It is intended to be fast and simple.
typedef float GfVec3f::ScalarType |
|
default |
Default constructor does no initialization.
|
inlineexplicit |
|
inlineexplicit |
|
inlineexplicit |
|
inlinestatic |
GF_API void GfVec3f::BuildOrthonormalFrame | ( | GfVec3f * | v1, |
GfVec3f * | v2, | ||
float | 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.
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 |
|
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.
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |