library of assembled shared sources |
http://lass.cocamware.com |
#include <ray_3d.h>
Data Structures | |
struct | Rebind |
Public Types | |
enum | { dimension = TPoint::dimension } |
typedef Ray3D< T, NormalizingPolicy, ParameterPolicy > | TSelf |
typedef NormalizingPolicy | TNormalizingPolicy |
typedef ParameterPolicy | TParameterPolicy |
typedef Point3D< T > | TPoint |
typedef TPoint::TVector | TVector |
typedef TPoint::TValue | TValue |
typedef TPoint::TParam | TParam |
typedef TPoint::TReference | TReference |
typedef TPoint::TConstReference | TConstReference |
typedef TPoint::TNumTraits | TNumTraits |
Public Member Functions | |
Ray3D () | |
Ray3D (const TPoint &iSupport, const TVector &iDirection) | |
Ray3D (const TPoint &iSupport, const TVector &iNormalizedDirection, IsAlreadyNormalized) | |
Ray3D (const TPoint &iSupport, const TPoint &iLookAt) | |
template<typename NP2 , typename PP2 > | |
Ray3D (const Ray3D< T, NP2, PP2 > &iOther) | |
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. | |
const bool | isValid () const |
Return true if ray is valid (direction isn't a zero vector). | |
Private Attributes | |
TPoint | support_ |
TVector | direction_ |
Related Functions | |
(Note that these are not member functions.) | |
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 , 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. | |
template<typename T , class NP > | |
std::ostream & | operator<< (std::ostream &ioOStream, const Ray3D< T, NP > &iRay) |
template<typename T , class NP > | |
io::XmlOStream & | operator<< (io::XmlOStream &ioOStream, const Ray3D< T, NP > &iRay) |
Definition at line 78 of file ray_3d.h.
typedef Ray3D<T, NormalizingPolicy, ParameterPolicy> lass::prim::Ray3D< T, NormalizingPolicy, ParameterPolicy >::TSelf |
typedef NormalizingPolicy lass::prim::Ray3D< T, NormalizingPolicy, ParameterPolicy >::TNormalizingPolicy |
typedef ParameterPolicy lass::prim::Ray3D< T, NormalizingPolicy, ParameterPolicy >::TParameterPolicy |
typedef Point3D<T> lass::prim::Ray3D< T, NormalizingPolicy, ParameterPolicy >::TPoint |
typedef TPoint::TVector lass::prim::Ray3D< T, NormalizingPolicy, ParameterPolicy >::TVector |
typedef TPoint::TValue lass::prim::Ray3D< T, NormalizingPolicy, ParameterPolicy >::TValue |
typedef TPoint::TParam lass::prim::Ray3D< T, NormalizingPolicy, ParameterPolicy >::TParam |
typedef TPoint::TReference lass::prim::Ray3D< T, NormalizingPolicy, ParameterPolicy >::TReference |
typedef TPoint::TConstReference lass::prim::Ray3D< T, NormalizingPolicy, ParameterPolicy >::TConstReference |
typedef TPoint::TNumTraits lass::prim::Ray3D< T, NormalizingPolicy, ParameterPolicy >::TNumTraits |
anonymous enum |
lass::prim::Ray3D< T, NP, PP >::Ray3D | ( | ) | [inline] |
lass::prim::Ray3D< T, NP, PP >::Ray3D | ( | const TPoint & | iSupport, | |
const TVector & | iDirection | |||
) | [inline] |
Definition at line 73 of file ray_3d.inl.
References lass::prim::Ray3D< T, NormalizingPolicy, ParameterPolicy >::direction_.
lass::prim::Ray3D< T, NP, PP >::Ray3D | ( | const TPoint & | iSupport, | |
const TVector & | iNormalizedDirection, | |||
IsAlreadyNormalized | ||||
) | [inline] |
Definition at line 83 of file ray_3d.inl.
lass::prim::Ray3D< T, NP, PP >::Ray3D | ( | const TPoint & | iSupport, | |
const TPoint & | iLookAt | |||
) | [inline] |
Definition at line 93 of file ray_3d.inl.
References lass::prim::Ray3D< T, NormalizingPolicy, ParameterPolicy >::direction_.
lass::prim::Ray3D< T, NP, PP >::Ray3D | ( | const Ray3D< T, NP2, PP2 > & | iOther | ) | [inline] |
Definition at line 104 of file ray_3d.inl.
References lass::prim::Ray3D< T, NormalizingPolicy, ParameterPolicy >::direction_.
const Ray3D< T, NP, PP >::TPoint & lass::prim::Ray3D< T, NP, PP >::support | ( | ) | const [inline] |
return origin of ray.
the origin is also the support point of the ray.
Definition at line 118 of file ray_3d.inl.
References lass::prim::Ray3D< T, NormalizingPolicy, ParameterPolicy >::support_.
Referenced by lass::prim::closestsPoints(), lass::prim::TriangleMesh3D< T, BoundingVolumeHierarchy, SplitHeuristics >::Triangle::intersect(), lass::prim::Triangle3D< T >::intersect(), lass::prim::impl::RaySphere< Normalized >::intersect(), lass::prim::impl::RaySphere< NormalizingPolicy >::intersect(), lass::prim::Parallelogram3D< T >::intersect(), lass::prim::Ray3D< T, NormalizingPolicy, ParameterPolicy >::intersect(), lass::prim::squaredDistance(), and lass::prim::Transformation3D< T >::transform().
Ray3D< T, NP, PP >::TPoint & lass::prim::Ray3D< T, NP, PP >::support | ( | ) | [inline] |
access origin of ray the origin is also the support point of the ray.
Definition at line 130 of file ray_3d.inl.
References lass::prim::Ray3D< T, NormalizingPolicy, ParameterPolicy >::support_.
const Ray3D< T, NP, PP >::TVector & lass::prim::Ray3D< T, NP, PP >::direction | ( | ) | const [inline] |
Return direction of ray.
Definition at line 141 of file ray_3d.inl.
References lass::prim::Ray3D< T, NormalizingPolicy, ParameterPolicy >::direction_.
Referenced by lass::prim::closestsPoints(), lass::prim::TriangleMesh3D< T, BoundingVolumeHierarchy, SplitHeuristics >::Triangle::intersect(), lass::prim::Triangle3D< T >::intersect(), lass::prim::impl::RaySphere< Normalized >::intersect(), lass::prim::impl::RaySphere< NormalizingPolicy >::intersect(), lass::prim::Parallelogram3D< T >::intersect(), lass::prim::Ray3D< T, NormalizingPolicy, ParameterPolicy >::intersect(), lass::prim::squaredDistance(), and lass::prim::Transformation3D< T >::transform().
void lass::prim::Ray3D< T, NP, PP >::setDirection | ( | const TVector & | iDirection | ) | [inline] |
Set direction and normalize it if that's the policy.
Definition at line 151 of file ray_3d.inl.
References lass::prim::Ray3D< T, NormalizingPolicy, ParameterPolicy >::direction_.
void lass::prim::Ray3D< T, NP, PP >::lookAt | ( | const TPoint & | iLookAt | ) | [inline] |
Set direction from origin to look-at point.
Definition at line 162 of file ray_3d.inl.
References lass::prim::Ray3D< T, NormalizingPolicy, ParameterPolicy >::direction_, and lass::prim::Ray3D< T, NormalizingPolicy, ParameterPolicy >::support_.
const Ray3D< T, NP, PP >::TPoint lass::prim::Ray3D< T, NP, PP >::point | ( | TParam | iT | ) | const [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.
References lass::prim::Ray3D< T, NormalizingPolicy, ParameterPolicy >::direction_, lass::prim::Ray3D< T, NormalizingPolicy, ParameterPolicy >::support_, and lass::num::NumTraits< C >::zero.
Referenced by lass::prim::closestsPoints(), lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::intersect(), and lass::prim::squaredDistance().
const Ray3D< T, NP, PP >::TValue lass::prim::Ray3D< T, NP, PP >::t | ( | const TPoint & | iPoint | ) | const [inline] |
Return parameter of point on the ray that is the projection of the given point.
Definition at line 190 of file ray_3d.inl.
References lass::prim::Ray3D< T, NormalizingPolicy, ParameterPolicy >::direction_, lass::prim::dot(), and lass::prim::Ray3D< T, NormalizingPolicy, ParameterPolicy >::support_.
Referenced by lass::prim::closestsPoints(), and lass::prim::squaredDistance().
const Ray3D< T, NP, PP >::TVector lass::prim::Ray3D< T, NP, PP >::project | ( | const TVector & | iVector | ) | const [inline] |
Project vector on the axis of the ray.
Definition at line 202 of file ray_3d.inl.
References lass::prim::Ray3D< T, NormalizingPolicy, ParameterPolicy >::direction_, and lass::prim::dot().
Referenced by lass::prim::closestsPoints(), lass::prim::Ray3D< T, NormalizingPolicy, ParameterPolicy >::project(), lass::prim::Ray3D< T, NormalizingPolicy, ParameterPolicy >::reflect(), lass::prim::Ray3D< T, NormalizingPolicy, ParameterPolicy >::reject(), and lass::prim::squaredDistance().
const Ray3D< T, NP, PP >::TVector lass::prim::Ray3D< T, NP, PP >::reject | ( | const TVector & | iVector | ) | const [inline] |
Reject vector against the axis of the ray.
Definition at line 213 of file ray_3d.inl.
References lass::prim::Ray3D< T, NormalizingPolicy, ParameterPolicy >::project().
Referenced by lass::prim::Ray3D< T, NormalizingPolicy, ParameterPolicy >::reject().
const Ray3D< T, NP, PP >::TVector lass::prim::Ray3D< T, NP, PP >::reflect | ( | const TVector & | iVector | ) | const [inline] |
Reflect vector against the axis of the ray.
Definition at line 224 of file ray_3d.inl.
References lass::prim::Ray3D< T, NormalizingPolicy, ParameterPolicy >::project().
Referenced by lass::prim::Ray3D< T, NormalizingPolicy, ParameterPolicy >::reflect().
const Ray3D< T, NP, PP >::TPoint lass::prim::Ray3D< T, NP, PP >::project | ( | const TPoint & | iPoint | ) | const [inline] |
Project point on the axis of the ray.
Definition at line 236 of file ray_3d.inl.
References lass::prim::Ray3D< T, NormalizingPolicy, ParameterPolicy >::project(), and lass::prim::Ray3D< T, NormalizingPolicy, ParameterPolicy >::support_.
const Ray3D< T, NP, PP >::TVector lass::prim::Ray3D< T, NP, PP >::reject | ( | const TPoint & | iPoint | ) | const [inline] |
Reject point against the axis of the ray.
Definition at line 247 of file ray_3d.inl.
References lass::prim::Ray3D< T, NormalizingPolicy, ParameterPolicy >::reject(), and lass::prim::Ray3D< T, NormalizingPolicy, ParameterPolicy >::support_.
const Ray3D< T, NP, PP >::TPoint lass::prim::Ray3D< T, NP, PP >::reflect | ( | const TPoint & | iPoint | ) | const [inline] |
Reject point against the axis of the ray.
Definition at line 258 of file ray_3d.inl.
References lass::prim::Ray3D< T, NormalizingPolicy, ParameterPolicy >::reflect(), and lass::prim::Ray3D< T, NormalizingPolicy, ParameterPolicy >::support_.
const bool lass::prim::Ray3D< T, NP, PP >::isValid | ( | ) | const [inline] |
Return true if ray is valid (direction isn't a zero vector).
Definition at line 268 of file ray_3d.inl.
References lass::prim::Ray3D< T, NormalizingPolicy, ParameterPolicy >::direction_, and lass::prim::Vector3D< T >::isZero().
Referenced by lass::prim::Ray3D< T, NormalizingPolicy, ParameterPolicy >::intersect().
Result intersect | ( | const Aabb3D< T, MMPAabb > & | aabb, | |
const Ray3D< T, NPRay, PPRay > & | ray, | |||
T & | t, | |||
const T & | tMin = T() | |||
) | [related] |
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.
References lass::prim::Ray3D< T, NormalizingPolicy, ParameterPolicy >::direction(), lass::prim::impl::interectSlab(), lass::prim::Aabb3D< T, MinMaxPolicy >::isEmpty(), lass::prim::Aabb3D< T, MinMaxPolicy >::max(), lass::prim::Aabb3D< T, MinMaxPolicy >::min(), lass::prim::rNone, lass::prim::rOne, lass::prim::Ray3D< T, NormalizingPolicy, ParameterPolicy >::support(), and lass::stde::T.
Result intersect | ( | const Plane3D< T, EPPlane, NPPlane > & | plane, | |
const Ray3D< T, NPRay, PPRay > & | ray, | |||
T & | t, | |||
const T & | tMin = T() | |||
) | [related] |
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.
References lass::prim::Plane3D< T, EquationPolicy, NormalizingPolicy >::classify(), lass::prim::Ray3D< T, NormalizingPolicy, ParameterPolicy >::direction(), lass::prim::dot(), lass::prim::impl::Plane3DCartesian< T, NormalizingPolicy >::equation(), lass::num::isNaN(), lass::prim::Ray3D< T, NormalizingPolicy, ParameterPolicy >::isValid(), lass::prim::impl::Plane3DCartesian< T, NormalizingPolicy >::isValid(), LASS_ASSERT, lass::prim::impl::Plane3DCartesian< T, NormalizingPolicy >::normal(), lass::prim::rInfinite, lass::prim::rInvalid, lass::prim::rNone, lass::prim::rOne, lass::prim::sBack, lass::prim::sFront, lass::prim::sSurface, and lass::prim::Ray3D< T, NormalizingPolicy, ParameterPolicy >::support().
std::ostream & operator<< | ( | std::ostream & | ioOStream, | |
const Ray3D< T, NP > & | iRay | |||
) | [related] |
io::XmlOStream & operator<< | ( | io::XmlOStream & | ioOStream, | |
const Ray3D< T, NP > & | iRay | |||
) | [related] |
TPoint lass::prim::Ray3D< T, NormalizingPolicy, ParameterPolicy >::support_ [private] |
Definition at line 133 of file ray_3d.h.
Referenced by lass::prim::Ray3D< T, NormalizingPolicy, ParameterPolicy >::lookAt(), lass::prim::Ray3D< T, NormalizingPolicy, ParameterPolicy >::point(), lass::prim::Ray3D< T, NormalizingPolicy, ParameterPolicy >::project(), lass::prim::Ray3D< T, NormalizingPolicy, ParameterPolicy >::Ray3D(), lass::prim::Ray3D< T, NormalizingPolicy, ParameterPolicy >::reflect(), lass::prim::Ray3D< T, NormalizingPolicy, ParameterPolicy >::reject(), lass::prim::Ray3D< T, NormalizingPolicy, ParameterPolicy >::support(), and lass::prim::Ray3D< T, NormalizingPolicy, ParameterPolicy >::t().
TVector lass::prim::Ray3D< T, NormalizingPolicy, ParameterPolicy >::direction_ [private] |
Definition at line 134 of file ray_3d.h.
Referenced by lass::prim::Ray3D< T, NormalizingPolicy, ParameterPolicy >::direction(), lass::prim::Ray3D< T, NormalizingPolicy, ParameterPolicy >::isValid(), lass::prim::Ray3D< T, NormalizingPolicy, ParameterPolicy >::lookAt(), lass::prim::Ray3D< T, NormalizingPolicy, ParameterPolicy >::point(), lass::prim::Ray3D< T, NormalizingPolicy, ParameterPolicy >::project(), lass::prim::Ray3D< T, NormalizingPolicy, ParameterPolicy >::Ray3D(), lass::prim::Ray3D< T, NormalizingPolicy, ParameterPolicy >::setDirection(), and lass::prim::Ray3D< T, NormalizingPolicy, ParameterPolicy >::t().
Generated on Mon Nov 10 14:22:14 2008 for Library of Assembled Shared Sources by 1.5.7.1 |