HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
openvdb::OPENVDB_VERSION_NAME::math::Ray< RealT > Class Template Reference

#include <Ray.h>

Classes

struct  TimeSpan
 

Public Types

using RealType = RealT
 
using Vec3Type = Vec3< RealT >
 
using Vec3T = Vec3Type
 

Public Member Functions

 Ray (const Vec3Type &eye=Vec3Type(0, 0, 0), const Vec3Type &direction=Vec3Type(1, 0, 0), RealT t0=math::Delta< RealT >::value(), RealT t1=std::numeric_limits< RealT >::max())
 
void setEye (const Vec3Type &eye)
 
void setDir (const Vec3Type &dir)
 
void setMinTime (RealT t0)
 
void setMaxTime (RealT t1)
 
void setTimes (RealT t0=math::Delta< RealT >::value(), RealT t1=std::numeric_limits< RealT >::max())
 
void scaleTimes (RealT scale)
 
void reset (const Vec3Type &eye, const Vec3Type &direction, RealT t0=math::Delta< RealT >::value(), RealT t1=std::numeric_limits< RealT >::max())
 
const Vec3Teye () const
 
const Vec3Tdir () const
 
const Vec3TinvDir () const
 
RealT t0 () const
 
RealT t1 () const
 
Vec3R operator() (RealT time) const
 Return the position along the ray at the specified time. More...
 
Vec3R start () const
 Return the starting point of the ray. More...
 
Vec3R end () const
 Return the endpoint of the ray. More...
 
Vec3R mid () const
 Return the midpoint of the ray. More...
 
bool valid (RealT eps=math::Delta< float >::value()) const
 Return true if t1 is larger than t0 by at least eps. More...
 
bool test (RealT time) const
 Return true if time is within t0 and t1, both inclusive. More...
 
template<typename MapType >
Ray applyMap (const MapType &map) const
 Return a new Ray that is transformed with the specified map. More...
 
template<typename MapType >
Ray applyInverseMap (const MapType &map) const
 Return a new Ray that is transformed with the inverse of the specified map. More...
 
template<typename GridType >
Ray indexToWorld (const GridType &grid) const
 Return a new ray in world space, assuming the existing ray is represented in the index space of the specified grid. More...
 
template<typename GridType >
Ray worldToIndex (const GridType &grid) const
 Return a new ray in the index space of the specified grid, assuming the existing ray is represented in world space. More...
 
bool intersects (const Vec3T &center, RealT radius, RealT &t0, RealT &t1) const
 Return true if this ray intersects the specified sphere. More...
 
bool intersects (const Vec3T &center, RealT radius) const
 Return true if this ray intersects the specified sphere. More...
 
bool clip (const Vec3T &center, RealT radius)
 Return true if this ray intersects the specified sphere. More...
 
template<typename BBoxT >
bool intersects (const BBoxT &bbox, RealT &t0, RealT &t1) const
 Return true if the Ray intersects the specified axisaligned bounding box. More...
 
template<typename BBoxT >
bool intersects (const BBoxT &bbox) const
 Return true if this ray intersects the specified bounding box. More...
 
template<typename BBoxT >
bool clip (const BBoxT &bbox)
 Return true if this ray intersects the specified bounding box. More...
 
bool intersects (const Vec3T &normal, RealT distance, RealT &t) const
 Return true if the Ray intersects the plane specified by a normal and distance from the origin. More...
 
bool intersects (const Vec3T &normal, const Vec3T &point, RealT &t) const
 Return true if the Ray intersects the plane specified by a normal and point. More...
 

Detailed Description

template<typename RealT = double>
class openvdb::OPENVDB_VERSION_NAME::math::Ray< RealT >

Definition at line 26 of file Ray.h.

Member Typedef Documentation

template<typename RealT = double>
using openvdb::OPENVDB_VERSION_NAME::math::Ray< RealT >::RealType = RealT

Definition at line 32 of file Ray.h.

template<typename RealT = double>
using openvdb::OPENVDB_VERSION_NAME::math::Ray< RealT >::Vec3T = Vec3Type

Definition at line 34 of file Ray.h.

template<typename RealT = double>
using openvdb::OPENVDB_VERSION_NAME::math::Ray< RealT >::Vec3Type = Vec3<RealT>

Definition at line 33 of file Ray.h.

Constructor & Destructor Documentation

template<typename RealT = double>
openvdb::OPENVDB_VERSION_NAME::math::Ray< RealT >::Ray ( const Vec3Type eye = Vec3Type(0,0,0),
const Vec3Type direction = Vec3Type(1,0,0),
RealT  t0 = math::Delta<RealT>::value(),
RealT  t1 = std::numeric_limits<RealT>::max() 
)
inline

Definition at line 56 of file Ray.h.

Member Function Documentation

template<typename RealT = double>
template<typename MapType >
Ray openvdb::OPENVDB_VERSION_NAME::math::Ray< RealT >::applyInverseMap ( const MapType &  map) const
inline

Return a new Ray that is transformed with the inverse of the specified map.

Parameters
mapthe map from which to construct the new Ray by inverse mapping.
Warning
Assumes a linear map and a normalized direction.

The requirement that the direction is normalized follows from the transformation of t0 and t1 - and that fact that we want applyMap and applyInverseMap to be inverse operations.

Definition at line 150 of file Ray.h.

template<typename RealT = double>
template<typename MapType >
Ray openvdb::OPENVDB_VERSION_NAME::math::Ray< RealT >::applyMap ( const MapType &  map) const
inline

Return a new Ray that is transformed with the specified map.

Parameters
mapthe map from which to construct the new Ray.
Warning
Assumes a linear map and a normalized direction.

The requirement that the direction is normalized follows from the transformation of t0 and t1 - and that fact that we want applyMap and applyInverseMap to be inverse operations.

Definition at line 132 of file Ray.h.

template<typename RealT = double>
bool openvdb::OPENVDB_VERSION_NAME::math::Ray< RealT >::clip ( const Vec3T center,
RealT  radius 
)
inline

Return true if this ray intersects the specified sphere.

Note
For intersection this ray is clipped to the two intersection points.
Parameters
centerThe center of the sphere in the same space as this ray.
radiusThe radius of the sphere in the same units as this ray.

Definition at line 217 of file Ray.h.

template<typename RealT = double>
template<typename BBoxT >
bool openvdb::OPENVDB_VERSION_NAME::math::Ray< RealT >::clip ( const BBoxT &  bbox)
inline

Return true if this ray intersects the specified bounding box.

Note
For intersection this ray is clipped to the two intersection points.
Parameters
bboxAxis-aligned bounding box in the same space as this ray.

Definition at line 260 of file Ray.h.

template<typename RealT = double>
const Vec3T& openvdb::OPENVDB_VERSION_NAME::math::Ray< RealT >::dir ( ) const
inline

Definition at line 99 of file Ray.h.

template<typename RealT = double>
Vec3R openvdb::OPENVDB_VERSION_NAME::math::Ray< RealT >::end ( void  ) const
inline

Return the endpoint of the ray.

Definition at line 114 of file Ray.h.

template<typename RealT = double>
const Vec3T& openvdb::OPENVDB_VERSION_NAME::math::Ray< RealT >::eye ( ) const
inline

Definition at line 97 of file Ray.h.

template<typename RealT = double>
template<typename GridType >
Ray openvdb::OPENVDB_VERSION_NAME::math::Ray< RealT >::indexToWorld ( const GridType &  grid) const
inline

Return a new ray in world space, assuming the existing ray is represented in the index space of the specified grid.

Definition at line 163 of file Ray.h.

template<typename RealT = double>
bool openvdb::OPENVDB_VERSION_NAME::math::Ray< RealT >::intersects ( const Vec3T center,
RealT  radius,
RealT &  t0,
RealT &  t1 
) const
inline

Return true if this ray intersects the specified sphere.

Parameters
centerThe center of the sphere in the same space as this ray.
radiusThe radius of the sphere in the same units as this ray.
t0The first intersection point if an intersection exists.
t1The second intersection point if an intersection exists.
Note
If the return value is true, i.e. a hit, and t0 = this->t0() or t1 == this->t1() only one true intersection exist.

Definition at line 183 of file Ray.h.

template<typename RealT = double>
bool openvdb::OPENVDB_VERSION_NAME::math::Ray< RealT >::intersects ( const Vec3T center,
RealT  radius 
) const
inline

Return true if this ray intersects the specified sphere.

Parameters
centerThe center of the sphere in the same space as this ray.
radiusThe radius of the sphere in the same units as this ray.

Definition at line 207 of file Ray.h.

template<typename RealT = double>
template<typename BBoxT >
bool openvdb::OPENVDB_VERSION_NAME::math::Ray< RealT >::intersects ( const BBoxT &  bbox,
RealT &  t0,
RealT &  t1 
) const
inline

Return true if the Ray intersects the specified axisaligned bounding box.

Parameters
bboxAxis-aligned bounding box in the same space as the Ray.
t0If an intersection is detected this is assigned the time for the first intersection point.
t1If an intersection is detected this is assigned the time for the second intersection point.

Definition at line 233 of file Ray.h.

template<typename RealT = double>
template<typename BBoxT >
bool openvdb::OPENVDB_VERSION_NAME::math::Ray< RealT >::intersects ( const BBoxT &  bbox) const
inline

Return true if this ray intersects the specified bounding box.

Parameters
bboxAxis-aligned bounding box in the same space as this ray.

Definition at line 250 of file Ray.h.

template<typename RealT = double>
bool openvdb::OPENVDB_VERSION_NAME::math::Ray< RealT >::intersects ( const Vec3T normal,
RealT  distance,
RealT &  t 
) const
inline

Return true if the Ray intersects the plane specified by a normal and distance from the origin.

Parameters
normalNormal of the plane.
distanceDistance of the plane to the origin.
tTime of intersection, if one exists.

Definition at line 273 of file Ray.h.

template<typename RealT = double>
bool openvdb::OPENVDB_VERSION_NAME::math::Ray< RealT >::intersects ( const Vec3T normal,
const Vec3T point,
RealT &  t 
) const
inline

Return true if the Ray intersects the plane specified by a normal and point.

Parameters
normalNormal of the plane.
pointPoint in the plane.
tTime of intersection, if one exists.

Definition at line 286 of file Ray.h.

template<typename RealT = double>
const Vec3T& openvdb::OPENVDB_VERSION_NAME::math::Ray< RealT >::invDir ( ) const
inline

Definition at line 101 of file Ray.h.

template<typename RealT = double>
Vec3R openvdb::OPENVDB_VERSION_NAME::math::Ray< RealT >::mid ( ) const
inline

Return the midpoint of the ray.

Definition at line 117 of file Ray.h.

template<typename RealT = double>
Vec3R openvdb::OPENVDB_VERSION_NAME::math::Ray< RealT >::operator() ( RealT  time) const
inline

Return the position along the ray at the specified time.

Definition at line 108 of file Ray.h.

template<typename RealT = double>
void openvdb::OPENVDB_VERSION_NAME::math::Ray< RealT >::reset ( const Vec3Type eye,
const Vec3Type direction,
RealT  t0 = math::Delta<RealT>::value(),
RealT  t1 = std::numeric_limits<RealT>::max() 
)
inline

Definition at line 86 of file Ray.h.

template<typename RealT = double>
void openvdb::OPENVDB_VERSION_NAME::math::Ray< RealT >::scaleTimes ( RealT  scale)
inline

Definition at line 84 of file Ray.h.

template<typename RealT = double>
void openvdb::OPENVDB_VERSION_NAME::math::Ray< RealT >::setDir ( const Vec3Type dir)
inline

Definition at line 66 of file Ray.h.

template<typename RealT = double>
void openvdb::OPENVDB_VERSION_NAME::math::Ray< RealT >::setEye ( const Vec3Type eye)
inline

Definition at line 64 of file Ray.h.

template<typename RealT = double>
void openvdb::OPENVDB_VERSION_NAME::math::Ray< RealT >::setMaxTime ( RealT  t1)
inline

Definition at line 74 of file Ray.h.

template<typename RealT = double>
void openvdb::OPENVDB_VERSION_NAME::math::Ray< RealT >::setMinTime ( RealT  t0)
inline

Definition at line 72 of file Ray.h.

template<typename RealT = double>
void openvdb::OPENVDB_VERSION_NAME::math::Ray< RealT >::setTimes ( RealT  t0 = math::Delta<RealT>::value(),
RealT  t1 = std::numeric_limits<RealT>::max() 
)
inline

Definition at line 76 of file Ray.h.

template<typename RealT = double>
Vec3R openvdb::OPENVDB_VERSION_NAME::math::Ray< RealT >::start ( ) const
inline

Return the starting point of the ray.

Definition at line 111 of file Ray.h.

template<typename RealT = double>
RealT openvdb::OPENVDB_VERSION_NAME::math::Ray< RealT >::t0 ( ) const
inline

Definition at line 103 of file Ray.h.

template<typename RealT = double>
RealT openvdb::OPENVDB_VERSION_NAME::math::Ray< RealT >::t1 ( ) const
inline

Definition at line 105 of file Ray.h.

template<typename RealT = double>
bool openvdb::OPENVDB_VERSION_NAME::math::Ray< RealT >::test ( RealT  time) const
inline

Return true if time is within t0 and t1, both inclusive.

Definition at line 123 of file Ray.h.

template<typename RealT = double>
bool openvdb::OPENVDB_VERSION_NAME::math::Ray< RealT >::valid ( RealT  eps = math::Delta<float>::value()) const
inline

Return true if t1 is larger than t0 by at least eps.

Definition at line 120 of file Ray.h.

template<typename RealT = double>
template<typename GridType >
Ray openvdb::OPENVDB_VERSION_NAME::math::Ray< RealT >::worldToIndex ( const GridType &  grid) const
inline

Return a new ray in the index space of the specified grid, assuming the existing ray is represented in world space.

Definition at line 171 of file Ray.h.


The documentation for this class was generated from the following file: