Blender V2.61 - r43446
Public Member Functions | Protected Member Functions

ntlRay Class Reference

the main ray class More...

#include <ntl_ray.h>

List of all members.

Public Member Functions

 ntlRay ()
 Initialize ray memebers, prints error message.
 ntlRay (const ntlRay &r)
 Copy constructor, copy all members.
 ntlRay (const ntlVec3Gfx &o, const ntlVec3Gfx &d, unsigned int i, gfxReal contrib, ntlRenderGlobals *glob)
 Explicitly init member variables with global render object.
 ~ntlRay ()
 Destructor.
void setRefracted (unsigned char set)
 Set the refraction flag for refracted rays.
void setReflected (unsigned char set)
const ntlColor shade ()
 main ray recursion function
void tracePhoton (ntlColor) const
void intersectFrontAABB (ntlVec3Gfx mStart, ntlVec3Gfx mEnd, gfxReal &t, ntlVec3Gfx &normal, ntlVec3Gfx &retcoord) const
 intersect ray with AABB
void intersectBackAABB (ntlVec3Gfx mStart, ntlVec3Gfx mEnd, gfxReal &t, ntlVec3Gfx &normal, ntlVec3Gfx &retcoord) const
 intersect ray with AABB
void intersectCompleteAABB (ntlVec3Gfx mStart, ntlVec3Gfx mEnd, gfxReal &tmin, gfxReal &tmax) const
 intersect ray with AABB
void intersectTriangle (vector< ntlVec3Gfx > *mpV, ntlTriangle *tri, gfxReal &t, gfxReal &u, gfxReal &v) const
 optimized intersect ray with triangle
void intersectTriangleX (vector< ntlVec3Gfx > *mpV, ntlTriangle *tri, gfxReal &t, gfxReal &u, gfxReal &v) const
 optimized intersect ray with triangle along +X axis dir
void intersectTriangleFront (vector< ntlVec3Gfx > *mpV, ntlTriangle *tri, gfxReal &t, gfxReal &u, gfxReal &v) const
 intersect only with front side
void intersectTriangleBack (vector< ntlVec3Gfx > *mpV, ntlTriangle *tri, gfxReal &t, gfxReal &u, gfxReal &v) const
 intersect ray only with backsides
ntlVec3Gfx getOrigin () const
 Returns the ray origin.
ntlVec3Gfx getDirection () const
 Returns the ray direction.
ntlVec3Gfx getNormal () const
unsigned char getRefracted () const
 Is this ray refracted?
unsigned char getReflected () const
ntlVec3Gfx getPositionAt (gfxReal t) const
ntlRenderGlobalsgetRenderglobals (void) const
int getID (void) const
void setOrigin (ntlVec3Gfx set)
void setDirection (ntlVec3Gfx set)
void setNormal (ntlVec3Gfx set)

Protected Member Functions

const ntlColor getShadedColor (ntlLightObject *light, const ntlRay &reflectedray, const ntlVec3Gfx &normal, ntlMaterial *surf) const

Detailed Description

the main ray class

Definition at line 45 of file ntl_ray.h.


Constructor & Destructor Documentation

ntlRay::ntlRay ( void  )

Initialize ray memebers, prints error message.

Definition at line 43 of file ntl_ray.cpp.

References errFatal, and SIMWORLD_GENERICERROR.

Referenced by shade().

ntlRay::ntlRay ( const ntlRay r)

Copy constructor, copy all members.

Definition at line 59 of file ntl_ray.cpp.

References ntlRenderGlobals::getCounterRays(), and ntlRenderGlobals::setCounterRays().

ntlRay::ntlRay ( const ntlVec3Gfx o,
const ntlVec3Gfx d,
unsigned int  i,
gfxReal  contrib,
ntlRenderGlobals glob 
)

Explicitly init member variables with global render object.

Definition at line 84 of file ntl_ray.cpp.

References ntlRenderGlobals::getCounterRays(), and ntlRenderGlobals::setCounterRays().

ntlRay::~ntlRay ( )

Destructor.

Definition at line 108 of file ntl_ray.cpp.


Member Function Documentation

ntlVec3Gfx ntlRay::getDirection ( ) const [inline]
int ntlRay::getID ( void  ) const [inline]

get this ray's ID

Definition at line 101 of file ntl_ray.h.

Referenced by ntlTree::intersect(), and ntlTree::intersectX().

ntlVec3Gfx ntlRay::getNormal ( ) const [inline]

Returns the ray relfection normal

Definition at line 92 of file ntl_ray.h.

Referenced by ntlLightObject::getShadedColor().

ntlVec3Gfx ntlRay::getOrigin ( ) const [inline]
ntlVec3Gfx ntlRay::getPositionAt ( gfxReal  t) const [inline]

Get position along ray

Definition at line 97 of file ntl_ray.h.

unsigned char ntlRay::getReflected ( ) const [inline]

Definition at line 95 of file ntl_ray.h.

unsigned char ntlRay::getRefracted ( ) const [inline]

Is this ray refracted?

Definition at line 94 of file ntl_ray.h.

ntlRenderGlobals* ntlRay::getRenderglobals ( void  ) const [inline]

Get render globals pointer of this ray

Definition at line 99 of file ntl_ray.h.

const ntlColor ntlRay::getShadedColor ( ntlLightObject light,
const ntlRay reflectedray,
const ntlVec3Gfx normal,
ntlMaterial surf 
) const [protected]
void ntlRay::intersectBackAABB ( ntlVec3Gfx  mStart,
ntlVec3Gfx  mEnd,
gfxReal t,
ntlVec3Gfx normal,
ntlVec3Gfx retcoord 
) const

intersect ray with AABB

Definition at line 214 of file ntl_ray.cpp.

References fabs(), getVecEpsilon(), GFX_REAL_MAX, i, LEFT, MIDDLE, NUMDIM, and RIGHT.

void ntlRay::intersectCompleteAABB ( ntlVec3Gfx  mStart,
ntlVec3Gfx  mEnd,
gfxReal tmin,
gfxReal tmax 
) const

intersect ray with AABB

Definition at line 300 of file ntl_ray.cpp.

References fabs(), getVecEpsilon(), GFX_REAL_MAX, i, LEFT, MIDDLE, NUMDIM, and RIGHT.

Referenced by ntlTree::intersect(), and ntlTree::intersectX().

void ntlRay::intersectFrontAABB ( ntlVec3Gfx  mStart,
ntlVec3Gfx  mEnd,
gfxReal t,
ntlVec3Gfx normal,
ntlVec3Gfx retcoord 
) const

intersect ray with AABB

Definition at line 126 of file ntl_ray.cpp.

References fabs(), getVecEpsilon(), GFX_REAL_MAX, i, LEFT, MIDDLE, NUMDIM, and RIGHT.

void ntlRay::intersectTriangle ( vector< ntlVec3Gfx > *  mpV,
ntlTriangle tri,
gfxReal t,
gfxReal u,
gfxReal v 
) const [inline]

optimized intersect ray with triangle

Definition at line 469 of file ntl_bsptree.cpp.

References cross(), dot(), ntlTriangle::getPoints(), GFX_REAL_MAX, p, and RAY_TRIANGLE_EPSILON.

Referenced by ntlTree::intersect().

void ntlRay::intersectTriangleBack ( vector< ntlVec3Gfx > *  mpV,
ntlTriangle tri,
gfxReal t,
gfxReal u,
gfxReal v 
) const [inline]

intersect ray only with backsides

Definition at line 921 of file ntl_bsptree.cpp.

References cross(), dot(), ntlTriangle::getPoints(), GFX_REAL_MAX, p, and RAY_TRIANGLE_EPSILON.

void ntlRay::intersectTriangleFront ( vector< ntlVec3Gfx > *  mpV,
ntlTriangle tri,
gfxReal t,
gfxReal u,
gfxReal v 
) const [inline]

intersect only with front side

Definition at line 899 of file ntl_bsptree.cpp.

References cross(), dot(), ntlTriangle::getPoints(), GFX_REAL_MAX, p, and RAY_TRIANGLE_EPSILON.

void ntlRay::intersectTriangleX ( vector< ntlVec3Gfx > *  mpV,
ntlTriangle tri,
gfxReal t,
gfxReal u,
gfxReal v 
) const [inline]

optimized intersect ray with triangle along +X axis dir

Definition at line 657 of file ntl_bsptree.cpp.

References cross(), dot(), ntlTriangle::getPoints(), GFX_REAL_MAX, p, and RAY_TRIANGLE_EPSILON.

Referenced by ntlTree::intersectX().

void ntlRay::setDirection ( ntlVec3Gfx  set) [inline]

Set direction of this ray

Definition at line 106 of file ntl_ray.h.

void ntlRay::setNormal ( ntlVec3Gfx  set) [inline]

Set normal of this ray

Definition at line 108 of file ntl_ray.h.

Referenced by shade().

void ntlRay::setOrigin ( ntlVec3Gfx  set) [inline]

Set origin of this ray

Definition at line 104 of file ntl_ray.h.

void ntlRay::setReflected ( unsigned char  set) [inline]

Definition at line 60 of file ntl_ray.h.

void ntlRay::setRefracted ( unsigned char  set) [inline]

Set the refraction flag for refracted rays.

Definition at line 59 of file ntl_ray.h.

Referenced by shade().

const ntlColor ntlRay::shade ( )
void ntlRay::tracePhoton ( ntlColor  ) const

Trace a photon through the scene


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