Scene Class Reference

Contains all primitive and material data representing a given 3D scene. More...

#include <Scene.h>

List of all members.

Public Member Functions

Constructors
 Scene (ShapeSet *shapeSet=NULL)
 Scene (const MaterialList &materials, ShapeSet *shapeSet=NULL)
virtual ~Scene ()
Initialization routines
virtual void init ()
Main usage interface
virtual real_t getIntersection (const Ray &ray, SurfacePoint &pt)
 Tests the given ray with this Shape for intersection. If a valid intersection exists, its "t" value will be returned and the given SurfacePoint will be initialized with enough data for this Shape to later fill in all relevant information lazily (world space normal at intersection point, uv coordinates, etc.).
virtual bool intersects (const Ray &ray, real_t tMax=INFINITY)
 Used for occlusion/visibility testing where you don't necessarily care about anything other than whether or not an intersection exists. (generally faster than getIntersection).
virtual void preview ()
virtual SpectralSampleSet getBackgroundRadiance (const Vector3 &w)
Accessors / Mutators
ShapeSetgetShapes ()
ShapeSetgetLights ()
EmitterSampler getEmitterSampler () const
MaterialgetDefaultMaterial ()
MaterialList & getMaterials ()
EmittergetBackground ()
void setBackground (Emitter *emitter)
bool isInitialized () const

Protected Attributes

ShapeSetm_shapes
ShapeSetm_lights
Emitterm_background
MaterialList m_materials
EmitterSampler m_emitterSampler
bool m_initted


Detailed Description

Contains all primitive and material data representing a given 3D scene.

Author:
Travis Fischer (fisch0920@gmail.com)

Matthew Jacobs (jacobs.mh@gmail.com)

Date:
Fall 2008

Definition at line 22 of file Scene.h.


Constructor & Destructor Documentation

Scene::Scene ( ShapeSet shapeSet = NULL  )  [inline, explicit]

Definition at line 27 of file Scene.h.

Scene::Scene ( const MaterialList &  materials,
ShapeSet shapeSet = NULL 
) [inline, explicit]

Definition at line 32 of file Scene.h.

Scene::~Scene (  )  [virtual]

Definition at line 19 of file Scene.cpp.


Member Function Documentation

void Scene::init (  )  [virtual]

Definition at line 30 of file Scene.cpp.

real_t Scene::getIntersection ( const Ray ray,
SurfacePoint pt 
) [virtual]

Tests the given ray with this Shape for intersection. If a valid intersection exists, its "t" value will be returned and the given SurfacePoint will be initialized with enough data for this Shape to later fill in all relevant information lazily (world space normal at intersection point, uv coordinates, etc.).

Note:
if you only care about whether or not an intersection exists and don't actually need to know the exact intersection point, see the intersects method instead.
Returns:
the smallest positive "t" value of any intersections found, or INFINITY if no valid intersection exists

Definition at line 103 of file Scene.cpp.

bool Scene::intersects ( const Ray ray,
real_t  tMax = INFINITY 
) [virtual]

Used for occlusion/visibility testing where you don't necessarily care about anything other than whether or not an intersection exists. (generally faster than getIntersection).

Note:
default implementation defers to getIntersection
Returns:
whether or not the given ray intersects this Shape with a positive "t" value greater than EPSILON and less than the given tMax

Definition at line 109 of file Scene.cpp.

void Scene::preview (  )  [virtual]

Displays a crude OpenGL preview of this scene

Definition at line 72 of file Scene.cpp.

SpectralSampleSet Scene::getBackgroundRadiance ( const Vector3 w  )  [virtual]

Returns:
the environment or background radiance emitted from beyond the extents of the scene in direction -w
Note:
you can think of background emission as a large spherical emitter surrounding the entire scene, emitting inwards

Definition at line 115 of file Scene.cpp.

ShapeSet* Scene::getShapes (  )  [inline]

Definition at line 100 of file Scene.h.

ShapeSet* Scene::getLights (  )  [inline]

Definition at line 104 of file Scene.h.

EmitterSampler Scene::getEmitterSampler (  )  const [inline]

Definition at line 108 of file Scene.h.

Material* Scene::getDefaultMaterial (  )  [inline]

Definition at line 112 of file Scene.h.

MaterialList& Scene::getMaterials (  )  [inline]

Definition at line 118 of file Scene.h.

Emitter* Scene::getBackground (  )  [inline]

Definition at line 122 of file Scene.h.

void Scene::setBackground ( Emitter emitter  )  [inline]

Definition at line 126 of file Scene.h.

bool Scene::isInitialized (  )  const [inline]

Definition at line 130 of file Scene.h.


Member Data Documentation

ShapeSet* Scene::m_shapes [protected]

Definition at line 138 of file Scene.h.

ShapeSet* Scene::m_lights [protected]

Definition at line 139 of file Scene.h.

Definition at line 140 of file Scene.h.

MaterialList Scene::m_materials [protected]

Definition at line 142 of file Scene.h.

Definition at line 143 of file Scene.h.

bool Scene::m_initted [protected]

Definition at line 144 of file Scene.h.


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

Generated on 28 Feb 2009 for Milton by doxygen 1.5.6