24 #ifndef PXR_BASE_GF_RAY_H 25 #define PXR_BASE_GF_RAY_H 32 #include "pxr/base/gf/api.h" 38 PXR_NAMESPACE_OPEN_SCOPE
97 return _startPoint + distance * _direction;
109 double *rayDistance = NULL)
const;
114 return (_startPoint == r._startPoint &&
115 _direction == r._direction);
121 return ! (*
this == r);
155 double *distance = NULL,
156 GfVec3d *barycentricCoords = NULL,
157 bool *frontFacing = NULL,
158 double maxDist = std::numeric_limits<double>::infinity())
170 bool *frontFacing = NULL)
const;
178 double *enterDistance = NULL,
179 double *exitDistance = NULL)
const;
187 double *enterDistance = NULL,
188 double *exitDistance = NULL)
const;
196 double *enterDistance = NULL,
197 double *exitDistance = NULL )
const;
211 double *enterDistance = NULL,
212 double *exitDistance = NULL)
const;
228 double *enterDistance = NULL,
229 double *exitDistance = NULL)
const;
236 double *,
double * );
240 double *,
double * );
245 bool _SolveQuadratic(
const double a,
248 double *enterDistance = NULL,
249 double *exitDistance = NULL)
const;
268 double *rayDistance =
nullptr,
269 double *lineDistance =
nullptr );
282 double *rayDistance =
nullptr,
283 double *segDistance =
nullptr );
289 PXR_NAMESPACE_CLOSE_SCOPE
291 #endif // PXR_BASE_GF_RAY_H Basic type: 3-dimensional floating point range.
GF_API void SetPointAndDirection(const GfVec3d &startPoint, const GfVec3d &direction)
Sets the ray by specifying a starting point and a direction.
GF_API GfRay & Transform(const GfMatrix4d &matrix)
Transforms the ray by the given matrix.
GfRay()
The default constructor leaves the ray parameters undefined.
GF_API bool Intersect(const GfVec3d &p0, const GfVec3d &p1, const GfVec3d &p2, double *distance=NULL, GfVec3d *barycentricCoords=NULL, bool *frontFacing=NULL, double maxDist=std::numeric_limits< double >::infinity()) const
Intersects the ray with the triangle formed by points p0, p1, and p2, returning true if it hits.
bool operator==(const GfRay &r) const
Component-wise equality test.
Basic type: 3-dimensional plane.
GfRay(const GfVec3d &startPoint, const GfVec3d &direction)
This constructor takes a starting point and a direction.
Stores a 4x4 matrix of double elements.
bool operator !=(const GfRay &r) const
Component-wise inequality test.
const GfVec3d & GetDirection() const
Returns the direction vector of the segment.
GfVec3d GetPoint(double distance) const
Returns the point that is distance units from the starting point along the direction vector,...
GF_API std::ostream & operator<<(std::ostream &, const GfRay &)
Output a GfRay using the format [(x y z) >> (x y z)].
const GfVec3d & GetStartPoint() const
Returns the starting point of the segment.
Basic type: 3D line segment.
Basic type for a vector of 3 double components.
Basic type: Ray used for intersection testing.
GF_API bool GfFindClosestPoints(const GfRay &ray, const GfLine &line, GfVec3d *rayPoint=nullptr, GfVec3d *linePoint=nullptr, double *rayDistance=nullptr, double *lineDistance=nullptr)
Computes the closest points between a ray and a line.
GF_API friend bool GfFindClosestPoints(const GfRay &, const GfLine &, GfVec3d *, GfVec3d *, double *, double *)
Computes the closest points between a ray and a line.
GF_API void SetEnds(const GfVec3d &startPoint, const GfVec3d &endPoint)
Sets the ray by specifying a starting point and an ending point.
Basic type: arbitrarily oriented 3D bounding box.
GF_API GfVec3d FindClosestPoint(const GfVec3d &point, double *rayDistance=NULL) const
Returns the point on the ray that is closest to point.