#include <Scene.h>
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 AABB & | getBoundingBox () const |
virtual const Point3D & | getCentroid () 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< Traceable > | sceneTree |
std::vector< Light * > * | lights |
bool | shadows |
bool | ownLights |
std::string | name |
Currently uses a BIH of Traceable to contain the objects in the scene.
Definition at line 19 of file Scene.h.
rcrt::Scene::Scene | ( | bool | shadows = false |
) |
rcrt::Scene::~Scene | ( | ) | [virtual] |
bool rcrt::Scene::isOccluded | ( | const Point3D & | point, | |
const Vec3D & | dir, | |||
const float & | maxDir | |||
) | const |
Provides a general occlusion test. Used for shadows.
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. |
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 | ) |
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] |
The | ray that will be tested against. |
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] |
const Point3D & rcrt::Scene::getCentroid | ( | ) | const [virtual] |
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.
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 | ) |
void rcrt::Scene::setName | ( | std::string | name | ) |
const string & rcrt::Scene::getName | ( | ) | const |
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] |
bool rcrt::Scene::ownLights [private] |
std::string rcrt::Scene::name [private] |