24 #ifndef PXR_BASE_GF_HOMOGENEOUS_H 25 #define PXR_BASE_GF_HOMOGENEOUS_H 36 #include "pxr/base/gf/api.h" 38 PXR_NAMESPACE_OPEN_SCOPE
66 float inv = (v[3] != 0.0f) ? 1.0f/v[3] : 1.0f;
67 return GfVec3f(inv * v[0], inv * v[1], inv * v[2]);
73 double inv = (v[3] != 0.0) ? 1.0/v[3] : 1.0;
74 return GfVec3d(inv * v[0], inv * v[1], inv * v[2]);
77 PXR_NAMESPACE_CLOSE_SCOPE
GfVec3f GfProject(const GfVec4f &v)
Projects homogeneous v into Euclidean space and returns the result as a Vec3f.
GF_API GfVec4f GfHomogeneousCross(const GfVec4f &a, const GfVec4f &b)
Homogenizes a and b and then performs the cross product on the first three elements of each.
Basic type for a vector of 3 float components.
Basic type for a vector of 4 double components.
Basic type for a vector of 4 float components.
GF_API GfVec4f GfGetHomogenized(const GfVec4f &v)
Returns a vector which is v homogenized.
Basic type for a vector of 3 double components.