Blender V2.61 - r43446
|
the main ray class More...
#include <ntl_ray.h>
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 |
ntlRenderGlobals * | getRenderglobals (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 |
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.
ntlVec3Gfx ntlRay::getDirection | ( | ) | const [inline] |
Returns the ray direction.
Definition at line 90 of file ntl_ray.h.
Referenced by ControlParticles::checkPointInside(), ntlTree::distanceToPlane(), LbmSolverInterface::geoInitCheckPointInside(), ntlLightObject::getShadedColor(), ntlTree::intersect(), and ntlTree::intersectX().
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] |
Returns the ray origin.
Definition at line 88 of file ntl_ray.h.
Referenced by ControlParticles::checkPointInside(), ntlTree::distanceToPlane(), LbmSolverInterface::geoInitCheckPointInside(), ntlLightObject::illuminatePoint(), ntlTree::intersect(), and ntlTree::intersectX().
ntlVec3Gfx ntlRay::getPositionAt | ( | gfxReal | t | ) | const [inline] |
unsigned char ntlRay::getRefracted | ( | ) | const [inline] |
ntlRenderGlobals* ntlRay::getRenderglobals | ( | void | ) | const [inline] |
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] |
void ntlRay::setNormal | ( | ntlVec3Gfx | set | ) | [inline] |
void ntlRay::setOrigin | ( | ntlVec3Gfx | set | ) | [inline] |
void ntlRay::setRefracted | ( | unsigned char | set | ) | [inline] |
const ntlColor ntlRay::shade | ( | ) |
main ray recursion function
First get closest object intersection, return background color if nothing was hit, else calculate shading and reflection components and return mixed color
Definition at line 448 of file ntl_ray.cpp.
References ntlMaterial::calculateFresnel(), dot(), equal(), errorOut, KDL::exp(), ntlRenderGlobals::getAmbientLight(), ntlMaterial::getAmbientRefl(), ntlRenderGlobals::getBackgroundCol(), ntlRenderGlobals::getCounterShades(), ntlRenderGlobals::getDebugOut(), ntlMaterial::getFresnel(), ntlRenderGlobals::getLightList(), ntlGeometryObject::getMaterial(), ntlMaterial::getMirror(), ntlTriangle::getNormal(), getNormalized(), ntlScene::getObject(), ntlTriangle::getObjectId(), ntlMaterial::getRefracIndex(), ntlRenderGlobals::getRenderScene(), ntlMaterial::getTransAttCol(), ntlMaterial::getTransparence(), getVecEpsilon(), GFX_REAL_MAX, ntlScene::intersectScene(), ntlRay(), NULL, RAY_MINCONTRIB, RAY_THRESHOLD, reflectVector(), refractVector(), ntlRenderGlobals::setCounterShades(), setNormal(), setRefracted(), and shade().
Referenced by shade().
void ntlRay::tracePhoton | ( | ntlColor | ) | const |
Trace a photon through the scene