rcrt::Scene Class Reference

#include <Scene.h>

Inheritance diagram for rcrt::Scene:

Inheritance graph
[legend]
Collaboration diagram for rcrt::Scene:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 Scene (std::vector< Traceable * > *trList, std::vector< Light * > *ls=0, bool shadows=false)
 Scene (bool shadows=false)
virtual ~Scene ()
bool isOccluded (const Point3D &point, const Vec3D &dir, const float &maxDir) const
void addLight (Light *light)
std::vector< Light * >
*const 
getLights () const
virtual Intersection intersect (Ray &r) const
virtual const AABBgetBoundingBox () const
virtual const Point3DgetCentroid () const
void setShadows (bool shadows)
bool castShadows () const
void setTraceables (std::vector< Traceable * > *trList)
void setLights (std::vector< Light * > *ls)
void setName (std::string name)
const std::string & getName () const
AABB clipBox (AABB &cbox) const

Private Attributes

BIH< TraceablesceneTree
std::vector< Light * > * lights
bool shadows
bool ownLights
std::string name


Detailed Description

The scene...

Currently uses a BIH of Traceable to contain the objects in the scene.

Definition at line 19 of file Scene.h.


Constructor & Destructor Documentation

rcrt::Scene::Scene ( std::vector< Traceable * > *  trList,
std::vector< Light * > *  ls = 0,
bool  shadows = false 
)

Parameters:
trList A vector of Traceable* to build this Scene from.
ls A vector of Light* to illuminate the Scene with.(Optional, defaults to NULL)
shadows Whether shadows should be cast. (Optional, defaults to false)

Definition at line 9 of file Scene.cpp.

References lights.

rcrt::Scene::Scene ( bool  shadows = false  ) 

Parameters:
shadows Whether shadows should be cast. (Optional, defaults to false)

Definition at line 17 of file Scene.cpp.

References lights.

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

Definition at line 22 of file Scene.cpp.

References lights, and ownLights.


Member Function Documentation

bool rcrt::Scene::isOccluded ( const Point3D point,
const Vec3D dir,
const float &  maxDir 
) const

Provides a general occlusion test. Used for shadows.

Parameters:
point Location in world space to check from.
dir Direction in which to check.(Away from the point.)
maxDir Any occluding object behind this distance will not be counted as an occlusion.
Returns:
True if this point is occluded from the -direction inside the given distance, false otherwise.

Definition at line 33 of file Scene.cpp.

References rcrt::Intersection::getDistance(), rcrt::Primitive::getMaterial(), rcrt::Intersection::getPrimitive(), intersect(), rcrt::Intersection::isValid(), rcrt::Vec3D::normalized(), and rcrt::Material::refracts().

Referenced by rcrt::SimpleTracer::directLight(), rcrt::PhotonTracer::directLight(), rcrt::AreaLight::getSample(), and rcrt::RayCaster::trace().

void rcrt::Scene::addLight ( Light light  ) 

Parameters:
light The light to add to this scene.

Definition at line 53 of file Scene.cpp.

References lights.

Referenced by rcrt::SceneLoader::goToFrame(), rcrt::SceneLoader::nextFrame(), and testDispl1().

vector< Light * > *const rcrt::Scene::getLights (  )  const

Definition at line 58 of file Scene.cpp.

References lights.

Referenced by rcrt::SimpleTracer::directLight(), rcrt::PhotonTracer::directLight(), rcrt::PhotonMap::generate(), and rcrt::RayCaster::trace().

Intersection rcrt::Scene::intersect ( Ray r  )  const [virtual]

Parameters:
The ray that will be tested against.
Returns:
An Intersection that contains the closest intersection that can be determined.

Implements rcrt::Traceable.

Definition at line 28 of file Scene.cpp.

References sceneTree.

Referenced by rcrt::PhotonMap::generateJob(), isOccluded(), rcrt::SimpleTracer::trace(), rcrt::RayCaster::trace(), rcrt::PhotonTracer::trace(), rcrt::DebugTracer::trace(), and rcrt::BIHTracer::trace().

const AABB & rcrt::Scene::getBoundingBox (  )  const [virtual]

Returns:
The minimum Axis-Aligned Bounding Box of this Traceable.

Implements rcrt::Traceable.

Definition at line 63 of file Scene.cpp.

References sceneTree.

Referenced by clipBox().

const Point3D & rcrt::Scene::getCentroid (  )  const [virtual]

Returns:
Some kind of central point of this object. This may just be an approximation (e.g. the central point of the AABB).

Implements rcrt::Traceable.

Definition at line 68 of file Scene.cpp.

References sceneTree.

void rcrt::Scene::setShadows ( bool  shadows  ) 

Definition at line 73 of file Scene.cpp.

References shadows.

Referenced by rcrtAnim(), testPhoton(), and testPhotonRCRT().

bool rcrt::Scene::castShadows (  )  const

Definition at line 78 of file Scene.cpp.

References shadows.

Referenced by rcrt::SimpleTracer::directLight(), rcrt::PhotonTracer::directLight(), rcrt::AreaLight::getSample(), and rcrt::RayCaster::trace().

void rcrt::Scene::setTraceables ( std::vector< Traceable * > *  trList  ) 

Sets new objects for this scene.

Parameters:
trList The Traceables.

Definition at line 83 of file Scene.cpp.

References sceneTree.

Referenced by rcrt::SceneLoader::goToFrame(), and rcrt::SceneLoader::nextFrame().

void rcrt::Scene::setLights ( std::vector< Light * > *  ls  ) 

Definition at line 88 of file Scene.cpp.

References lights.

void rcrt::Scene::setName ( std::string  name  ) 

Definition at line 97 of file Scene.cpp.

References name.

Referenced by rcrt::SceneLoader::init().

const string & rcrt::Scene::getName (  )  const

Definition at line 102 of file Scene.cpp.

References name.

Referenced by testLoaders().

AABB rcrt::Scene::clipBox ( AABB cbox  )  const

Definition at line 107 of file Scene.cpp.

References getBoundingBox().


Member Data Documentation

BIH<Traceable> rcrt::Scene::sceneTree [private]

Definition at line 22 of file Scene.h.

Referenced by getBoundingBox(), getCentroid(), intersect(), and setTraceables().

std::vector<Light*>* rcrt::Scene::lights [private]

Definition at line 24 of file Scene.h.

Referenced by addLight(), getLights(), Scene(), setLights(), and ~Scene().

bool rcrt::Scene::shadows [private]

Definition at line 25 of file Scene.h.

Referenced by castShadows(), and setShadows().

bool rcrt::Scene::ownLights [private]

Definition at line 25 of file Scene.h.

Referenced by ~Scene().

std::string rcrt::Scene::name [private]

Definition at line 26 of file Scene.h.

Referenced by getName(), and setName().


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