Library of Assembled Shared Sources
|
3D Ray More...
#include <ray_3d.h>
Public Member Functions | |
const TPoint & | support () const |
return origin of ray. | |
TPoint & | support () |
access origin of ray the origin is also the support point of the ray. | |
const TVector & | direction () const |
Return direction of ray. | |
void | setDirection (const TVector &iDirection) |
Set direction and normalize it if that's the policy. | |
void | lookAt (const TPoint &iLookAt) |
Set direction from origin to look-at point. | |
const TPoint | point (TParam a_t) const |
Return point on ray by it's parameter. | |
const TValue | t (const TPoint &iPoint) const |
Return parameter of point on the ray that is the projection of the given point. | |
const TVector | project (const TVector &iVector) const |
Project vector on the axis of the ray. | |
const TVector | reject (const TVector &iVector) const |
Reject vector against the axis of the ray. | |
const TVector | reflect (const TVector &iVector) const |
Reflect vector against the axis of the ray. | |
const TPoint | project (const TPoint &iPoint) const |
Project point on the axis of the ray. | |
const TVector | reject (const TPoint &iPoint) const |
Reject point against the axis of the ray. | |
const TPoint | reflect (const TPoint &iPoint) const |
Reject point against the axis of the ray. | |
bool | isValid () const |
Return true if ray is valid (direction isn't a zero vector). | |
Related Symbols | |
(Note that these are not member symbols.) | |
template<typename T, typename MMPAabb, typename NPRay, typename PPRay> | |
Result | intersect (const Aabb3D< T, MMPAabb > &aabb, const Ray3D< T, NPRay, PPRay > &ray, T &t, const T &tMin=T()) |
Find the intersection of an AABB and ray by their parameter t on the ray. | |
template<typename T, typename MMPAabb, typename NPRay, typename PPRay> | |
Result | intersect (const Aabb3D< T, MMPAabb > &aabb, const Ray3D< T, NPRay, PPRay > &ray, const Vector3D< T > &invDirection, T &t, const T &tMin=T()) |
Find the intersection of an AABB and ray by their parameter t on the ray. | |
template<typename T, class EPPlane, class NPPlane, class NPRay, class PPRay> | |
Result | intersect (const Plane3D< T, EPPlane, NPPlane > &plane, const Ray3D< T, NPRay, PPRay > &ray, T &t, const T &tMin=T()) |
Find the intersection of a plane and ray by their parameter t on the ray. | |
3D Ray
const Ray3D< T, NP, PP >::TPoint & lass::prim::Ray3D< T, NP, PP >::support | ( | ) | const |
return origin of ray.
the origin is also the support point of the ray.
Definition at line 118 of file ray_3d.inl.
References support().
Referenced by lass::prim::Parallelogram3D< U >::intersect(), intersect(), intersect(), intersect(), lass::prim::Triangle3D< U >::intersect(), lass::prim::Triangle3D< U >::intersect(), support(), support(), lass::prim::Transformation3D< U >::transform(), and lass::prim::Transformation3D< U >::transform().
|
inline |
Return point on ray by it's parameter.
throw | an error if parameter is out of range t >= 0, if Bounded is used as ParameterPolicy . |
Definition at line 177 of file ray_3d.inl.
Referenced by lass::prim::SimplePolygon3D< U, PlaneEquationPolicy, PlaneNormalizingPolicy >::intersect(), point(), and t().
|
inline |
|
Find the intersection of an AABB and ray by their parameter t on the ray.
aabb | [in] the AABB |
ray | [in] the ray |
tMin | [in] the minimum t that may be returned as valid intersection. |
t | [out] the parameter of the intersection point > tMin. |
Definition at line 72 of file aabb_3d_ray_3d.h.
|
Find the intersection of an AABB and ray by their parameter t on the ray.
This version accepts a precomputed reciprocal of the ray direction (1/x, 1/y, 1/z). This is useful when you do many intersections with the same ray, so the reciprocal needs only to be computed once.
aabb | [in] the AABB |
ray | [in] the ray |
invDirection | [in] the reciprocal of the ray direction |
tMin | [in] the minimum t that may be returned as valid intersection. |
t | [out] the parameter of the intersection point > tMin. |
Definition at line 131 of file aabb_3d_ray_3d.h.
|
Find the intersection of a plane and ray by their parameter t on the ray.
plane | [in] the plane |
ray | [in] the ray |
t | [out] the parameter of the intersection point > tMin. |
tMin | [in] the minimum t that may be returned as valid intersection. |
Definition at line 74 of file plane_3d_ray_3d.h.