Library of Assembled Shared Sources
|
2D Ray More...
#include <ray_2d.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. | |
Side | classify (const TPoint &iPoint) const |
Return on what side a point is located. | |
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 Aabb2D< T, MMPAabb > &aabb, const Ray2D< 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 Aabb2D< T, MMPAabb > &aabb, const Ray2D< T, NPRay, PPRay > &ray, const Vector2D< 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 EP1, class NP1, class NP2, class PP2> | |
Result | intersect (const Line2D< T, EP1, NP1 > &line, const Ray2D< T, NP2, PP2 > &ray, T &t, const T &tMin=T()) |
Find the intersection of a line and ray by their parameter t on the ray. | |
template<typename T, class PP1, class NP2, class PP2> | |
Result | intersect (const LineSegment2D< T, PP1 > &lineSegment, const Ray2D< T, NP2, PP2 > &ray, T &t, const T &tMin=T()) |
Find the intersection of a ray and a line segment by parameter t on the ray. | |
2D Ray
const Ray2D< T, NP, PP >::TPoint & lass::prim::Ray2D< T, NP, PP >::support | ( | ) | const |
return origin of ray.
the origin is also the support point of the ray.
Definition at line 97 of file ray_2d.inl.
References support().
Referenced by intersect(), intersect(), intersect(), intersect(), lass::prim::SimplePolygon2D< T, NoDegenerate >::intersect(), lass::prim::Triangle2D< U >::intersect(), lass::spat::PlanarMesh::shoot(), support(), and support().
const Ray2D< T, NP, PP >::TPoint lass::prim::Ray2D< T, NP, PP >::point | ( | TParam | iT | ) | const |
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 156 of file ray_2d.inl.
References point().
Referenced by lass::spat::PlanarMesh::locate(), point(), and lass::spat::PlanarMesh::shoot().
const Ray2D< T, NP, PP >::TValue lass::prim::Ray2D< T, NP, PP >::t | ( | const TPoint & | iPoint | ) | const |
Return parameter of point on the ray that is the projection of the given point.
Definition at line 169 of file ray_2d.inl.
References t().
Referenced by lass::spat::PlanarMesh::locate(), lass::spat::PlanarMesh::shoot(), and t().
|
Find the intersection of an AABB and ray by their parameter t on the ray.
aabb | [in] the AABB |
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 70 of file aabb_2d_ray_2d.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 |
t | [out] the parameter of the intersection point > tMin. |
tMin | [in] the minimum t that may be returned as valid intersection. |
Definition at line 132 of file aabb_2d_ray_2d.h.
|
Find the intersection of a line and ray by their parameter t on the ray.
line | [in] the line |
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 line_2d_ray_2d.h.
|
Find the intersection of a ray and a line segment by parameter t on the ray.
lineSegment | [in] the line segment |
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 70 of file line_segment_2d_ray_2d.h.