rcrt::Intersection Class Reference

#include <Intersection.h>

Collaboration diagram for rcrt::Intersection:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 Intersection ()
 Intersection (const float dist, const Primitive *p, const Point3D &pos, const float param1, const float param2, bool bs=false)
virtual ~Intersection ()
void setUV (const Point2D &uv)
bool isValid () const
float getDistance () const
const Primitive *const getPrimitive () const
const Point3DgetPosition () const
const Vec3DgetSNormalW ()
const Vec3DgetGNormalW ()
const Vec3DgetSNormalL ()
const Vec3DgetGNormalL ()
void setSNormalW (const Vec3D &no)
void setGNormalW (const Vec3D &no)
void setSNormalL (const Vec3D &no)
void setGNormalL (const Vec3D &no)
void setPrimitive (const Primitive *p)
void setLastIOR (const std::complex< float > &ior)
void setLastIOR (const float &real, const float &imag=0)
const std::complex
< float > & 
getLastIOR () const
const Point2DgetUV ()
const Point2DgetParams () const
const bool & backSide () const

Private Attributes

float distance
const Primitiveprim
Point3D position
Point2D parameters
Vec3D shadingNormal
Vec3D geomNormal
Vec3D shadingNormalLocal
Vec3D geomNormalLocal
Point2D uv
bool initSNo
bool initGNo
bool initSNoL
bool initGNoL
bool initUV
bool backside
std::complex< float > lastIOR


Detailed Description

Contains data about points of ray-surface intersection.

Definition at line 17 of file Intersection.h.


Constructor & Destructor Documentation

rcrt::Intersection::Intersection (  ) 

Definition at line 12 of file Intersection.cpp.

rcrt::Intersection::Intersection ( const float  dist,
const Primitive p,
const Point3D pos,
const float  param1,
const float  param2,
bool  bs = false 
)

Constructs an Intersection.

Parameters:
dist The distance to the point of intersection.
p The primitive that was hit.
pos The point of intersection.
param1 2D Parameterization of the surface. E.g. barycentric coordinates for triangles.
param2 see param1
bs Whether this point was hit from the backside.

Definition at line 16 of file Intersection.cpp.

rcrt::Intersection::~Intersection (  )  [virtual]

Definition at line 28 of file Intersection.cpp.


Member Function Documentation

void rcrt::Intersection::setUV ( const Point2D uv  ) 

Parameters:
uv The texture uv coordinates of this intersection point.

Definition at line 32 of file Intersection.cpp.

References uv.

Referenced by rcrt::Triangle::intersect(), and rcrt::ConvexQuad::isInside().

bool rcrt::Intersection::isValid (  )  const

Returns:
Whether this is a valid intersection.

Definition at line 37 of file Intersection.cpp.

References prim.

Referenced by rcrt::SAHKDtree< rcrt::Triangle >::intersect(), rcrt::DisplacedTriangle::intersect(), rcrt::DynamicObject::intersect(), rcrt::AffineObject::intersect(), rcrt::BIHNode< rcrt::Traceable >::intersect(), rcrt::SAHKDtree< rcrt::Triangle >::intersectNode(), rcrt::Scene::isOccluded(), rcrt::BIHNode< rcrt::Traceable >::leafIntersect(), rcrt::SimpleTracer::trace(), rcrt::RayCaster::trace(), rcrt::PhotonTracer::trace(), rcrt::DebugTracer::trace(), and rcrt::BIHTracer::trace().

float rcrt::Intersection::getDistance (  )  const

Definition at line 42 of file Intersection.cpp.

References distance.

Referenced by rcrt::DisplacedTriangle::intersect(), rcrt::BIHNode< rcrt::Traceable >::intersect(), rcrt::SAHKDtree< rcrt::Triangle >::intersectNode(), rcrt::Scene::isOccluded(), rcrt::BIHNode< rcrt::Traceable >::leafIntersect(), rcrt::DielectricMaterial::scatterPhoton(), rcrt::SimpleTracer::trace(), rcrt::RayCaster::trace(), rcrt::PhotonTracer::trace(), and rcrt::DebugTracer::trace().

const Primitive *const rcrt::Intersection::getPrimitive (  )  const

Definition at line 46 of file Intersection.cpp.

References prim.

Referenced by rcrt::SimpleTracer::directLight(), rcrt::PhotonTracer::directLight(), rcrt::PhotonMap::getRadiance(), rcrt::Material::getShadingNormal(), rcrt::DisplacedTriangle::intersect(), rcrt::AffineObject::intersect(), rcrt::Scene::isOccluded(), rcrt::SimpleTracer::trace(), rcrt::RayCaster::trace(), and rcrt::PhotonTracer::trace().

const Point3D & rcrt::Intersection::getPosition (  )  const

Definition at line 51 of file Intersection.cpp.

References position.

Referenced by rcrt::WallMaterial::calcDistNormal(), rcrt::SimpleTracer::directLight(), rcrt::PhotonTracer::directLight(), rcrt::LightMaterial::getEmitted(), rcrt::PhotonMap::getRadiance(), rcrt::WoodMaterial::getShadingNormal(), rcrt::DisplacedTriangle::intersect(), rcrt::AffineObject::intersect(), rcrt::ConvexQuad::isInside(), rcrt::WoodMaterial::sample(), rcrt::WallMaterial::sample(), rcrt::WoodMaterial::scatterPhoton(), rcrt::MirrorMaterial::scatterPhoton(), rcrt::ImageMaterial::scatterPhoton(), rcrt::DielectricMaterial::scatterPhoton(), rcrt::BSDFMaterial::scatterPhoton(), rcrt::SimpleTracer::trace(), rcrt::RayCaster::trace(), and rcrt::PhotonTracer::trace().

const Vec3D & rcrt::Intersection::getSNormalW (  ) 

Returns:
The shading normal in world space.

Definition at line 56 of file Intersection.cpp.

References rcrt::Primitive::getSNormalWorld(), initSNo, initSNoL, rcrt::Primitive::normalToWorld(), parameters, prim, shadingNormal, shadingNormalLocal, rcrt::Point2D::x(), and rcrt::Point2D::y().

Referenced by rcrt::WallMaterial::calcDistNormal(), rcrt::PhotonTracer::directLight(), rcrt::WoodMaterial::getShadingNormal(), rcrt::WallMaterial::getShadingNormal(), rcrt::Material::getShadingNormal(), rcrt::MirrorMaterial::scatterPhoton(), rcrt::DebugMaterial::scatterPhoton(), rcrt::RayCaster::trace(), and rcrt::DebugTracer::trace().

const Vec3D & rcrt::Intersection::getGNormalW (  ) 

Returns:
The geometry normal in world space.

Definition at line 70 of file Intersection.cpp.

References geomNormal, geomNormalLocal, rcrt::Primitive::getGNormalWorld(), initGNo, initGNoL, rcrt::Primitive::normalToWorld(), parameters, prim, rcrt::Point2D::x(), and rcrt::Point2D::y().

Referenced by rcrt::BSDFMaterial::sample(), rcrt::BSDFMaterial::sampleDiffuse(), and rcrt::BSDFMaterial::sampleSpecular().

const Vec3D & rcrt::Intersection::getSNormalL (  ) 

Returns:
The shading normal in local space.

Definition at line 84 of file Intersection.cpp.

References rcrt::Primitive::getSNormal(), initSNoL, parameters, prim, shadingNormalLocal, rcrt::Point2D::x(), and rcrt::Point2D::y().

Referenced by rcrt::AffineObject::intersect().

const Vec3D & rcrt::Intersection::getGNormalL (  ) 

Returns:
The geometry normal in local space.

Definition at line 93 of file Intersection.cpp.

References geomNormalLocal, rcrt::Primitive::getGNormal(), initGNoL, parameters, prim, rcrt::Point2D::x(), and rcrt::Point2D::y().

Referenced by rcrt::AffineObject::intersect().

void rcrt::Intersection::setSNormalW ( const Vec3D no  ) 

Definition at line 102 of file Intersection.cpp.

References initSNo, and shadingNormal.

Referenced by rcrt::WallMaterial::distortNormal().

void rcrt::Intersection::setGNormalW ( const Vec3D no  ) 

Definition at line 108 of file Intersection.cpp.

References geomNormal, and initGNo.

void rcrt::Intersection::setSNormalL ( const Vec3D no  ) 

Definition at line 114 of file Intersection.cpp.

References initSNoL, and shadingNormalLocal.

Referenced by rcrt::Sphere::intersect(), and rcrt::DisplacedTriangle::intersect().

void rcrt::Intersection::setGNormalL ( const Vec3D no  ) 

Definition at line 120 of file Intersection.cpp.

References geomNormalLocal, and initGNoL.

Referenced by rcrt::Sphere::intersect(), and rcrt::DisplacedTriangle::intersect().

void rcrt::Intersection::setPrimitive ( const Primitive p  ) 

Definition at line 126 of file Intersection.cpp.

References prim.

Referenced by rcrt::DisplacedTriangle::intersect().

void rcrt::Intersection::setLastIOR ( const std::complex< float > &  ior  ) 

TODO needs refactoring, should not be inside the Intersection

Parameters:
The ior of a previous intersection.

Definition at line 150 of file Intersection.cpp.

References lastIOR.

void rcrt::Intersection::setLastIOR ( const float &  real,
const float &  imag = 0 
)

Definition at line 156 of file Intersection.cpp.

References lastIOR.

const complex< float > & rcrt::Intersection::getLastIOR (  )  const

Definition at line 161 of file Intersection.cpp.

References lastIOR.

Referenced by rcrt::DielectricMaterial::scatterPhoton(), and rcrt::BSDFMaterial::scatterPhoton().

const Point2D & rcrt::Intersection::getUV (  ) 

Definition at line 131 of file Intersection.cpp.

References rcrt::Primitive::getUV(), initUV, parameters, prim, uv, rcrt::Point2D::x(), and rcrt::Point2D::y().

Referenced by rcrt::Material::getShadingNormal(), rcrt::ImageMaterial::sample(), rcrt::ImageMaterial::sampleDiffuse(), rcrt::ImageMaterial::sampleSpecular(), and rcrt::ImageMaterial::scatterPhoton().

const Point2D & rcrt::Intersection::getParams (  )  const

Definition at line 140 of file Intersection.cpp.

References parameters.

Referenced by rcrt::DisplacedTriangle::intersect(), and rcrt::AffineObject::intersect().

const bool & rcrt::Intersection::backSide (  )  const

Definition at line 145 of file Intersection.cpp.

References backside.

Referenced by rcrt::WoodMaterial::getShadingNormal(), rcrt::Material::getShadingNormal(), rcrt::AffineObject::intersect(), rcrt::DebugMaterial::sample(), rcrt::DielectricMaterial::scatterPhoton(), rcrt::BSDFMaterial::scatterPhoton(), rcrt::SimpleTracer::trace(), rcrt::PhotonTracer::trace(), and rcrt::DebugTracer::trace().


Member Data Documentation

float rcrt::Intersection::distance [private]

Definition at line 20 of file Intersection.h.

Referenced by getDistance().

const Primitive* rcrt::Intersection::prim [private]

Definition at line 21 of file Intersection.h.

Referenced by getGNormalL(), getGNormalW(), getPrimitive(), getSNormalL(), getSNormalW(), getUV(), isValid(), and setPrimitive().

Point3D rcrt::Intersection::position [private]

Definition at line 22 of file Intersection.h.

Referenced by getPosition().

Point2D rcrt::Intersection::parameters [private]

Definition at line 23 of file Intersection.h.

Referenced by getGNormalL(), getGNormalW(), getParams(), getSNormalL(), getSNormalW(), and getUV().

Vec3D rcrt::Intersection::shadingNormal [private]

Definition at line 24 of file Intersection.h.

Referenced by getSNormalW(), and setSNormalW().

Vec3D rcrt::Intersection::geomNormal [private]

Definition at line 25 of file Intersection.h.

Referenced by getGNormalW(), and setGNormalW().

Vec3D rcrt::Intersection::shadingNormalLocal [private]

Definition at line 26 of file Intersection.h.

Referenced by getSNormalL(), getSNormalW(), and setSNormalL().

Vec3D rcrt::Intersection::geomNormalLocal [private]

Definition at line 27 of file Intersection.h.

Referenced by getGNormalL(), getGNormalW(), and setGNormalL().

Point2D rcrt::Intersection::uv [private]

Definition at line 28 of file Intersection.h.

Referenced by getUV(), and setUV().

bool rcrt::Intersection::initSNo [private]

Definition at line 29 of file Intersection.h.

Referenced by getSNormalW(), and setSNormalW().

bool rcrt::Intersection::initGNo [private]

Definition at line 29 of file Intersection.h.

Referenced by getGNormalW(), and setGNormalW().

bool rcrt::Intersection::initSNoL [private]

Definition at line 29 of file Intersection.h.

Referenced by getSNormalL(), getSNormalW(), and setSNormalL().

bool rcrt::Intersection::initGNoL [private]

Definition at line 29 of file Intersection.h.

Referenced by getGNormalL(), getGNormalW(), and setGNormalL().

bool rcrt::Intersection::initUV [private]

Definition at line 29 of file Intersection.h.

Referenced by getUV().

bool rcrt::Intersection::backside [private]

Definition at line 29 of file Intersection.h.

Referenced by backSide().

std::complex<float> rcrt::Intersection::lastIOR [private]

Definition at line 30 of file Intersection.h.

Referenced by getLastIOR(), and setLastIOR().


The documentation for this class was generated from the following files:
Generated on Thu Jan 31 19:32:28 2008 for RenderingCompetitionRayTracer by  doxygen 1.5.3