7#ifndef PXR_BASE_GF_HOMOGENEOUS_H
8#define PXR_BASE_GF_HOMOGENEOUS_H
19#include "pxr/base/gf/api.h"
21PXR_NAMESPACE_OPEN_SCOPE
49 float inv = (v[3] != 0.0f) ? 1.0f/v[3] : 1.0f;
50 return GfVec3f(inv * v[0], inv * v[1], inv * v[2]);
56 double inv = (v[3] != 0.0) ? 1.0/v[3] : 1.0;
57 return GfVec3d(inv * v[0], inv * v[1], inv * v[2]);
60PXR_NAMESPACE_CLOSE_SCOPE
Basic type for a vector of 3 double components.
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.
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.
GfVec3f GfProject(const GfVec4f &v)
Projects homogeneous v into Euclidean space and returns the result as a Vec3f.