Scene Class Reference

An element of the demo. More...

#include <Scene.h>

Inheritance diagram for Scene:

GroupCullingScene LandscapeScene TestScene TorusScene List of all members.

Public Member Functions

 Scene ()
 ~Scene ()
virtual void Init ()
void Render (int time, int culling_mode, bool level_of_detail)
void Monitor (int time, Camera *monitor, int culling_mode, bool level_of_detail)
void CopyPosition (int time, Camera *destination)
void PrintToConsole ()

Protected Member Functions

void AddObject (GraphicalObject *obj)
void AddLight (Light *light)

Protected Attributes

Cameracamera

Private Types

typedef Scene::GraphicalObjectElem GraphicalObjectList
typedef Scene::LightElem LightList

Private Member Functions

void NextLightId ()
void TurnOffLights ()
void ApplyLights (int time)

Private Attributes

GraphicalObjectListfirst_object
GraphicalObjectcamera_object
LightListfirst_light
int current_light_id

Classes

struct  GraphicalObjectElem
struct  LightElem

Detailed Description

An element of the demo.

A Scene is a part of a demo. It consists of one camera used to capture the scene, a set of lights used to illuminate the scene and a set of objects which make up the environment of the scene. A Scene is an abstract class, which means that every descendant that implements a scene has to implement the way the scene is initialized (built). This initialization routine will be called when the demo which the scene belongs to gets initialized.

Definition at line 22 of file Scene.h.


Member Typedef Documentation

typedef struct Scene::GraphicalObjectElem Scene::GraphicalObjectList [private]
 

Data structure to hold the graphical objects.

typedef struct Scene::LightElem Scene::LightList [private]
 

Data structure to hold the lights of the scene.


Constructor & Destructor Documentation

Scene::Scene  ) 
 

Constructor: Brings the object into a consistent state.

Definition at line 7 of file Scene.cpp.

Scene::~Scene  ) 
 

Destructor.

Definition at line 21 of file Scene.cpp.


Member Function Documentation

void Scene::AddLight Light light  )  [protected]
 

Adds a light to the scene.

Parameters:
light The light which shall be added to the scene.

Definition at line 123 of file Scene.cpp.

void Scene::AddObject GraphicalObject obj  )  [protected]
 

Adds an object to the scene.

Parameters:
obj The object which shall be added to the scene.

Definition at line 102 of file Scene.cpp.

void Scene::ApplyLights int  time  )  [private]
 

Applies all the lights of the scene at any given time.

Parameters:
time Time in milliseconds at which the lights shall be applied.

Definition at line 152 of file Scene.cpp.

void Scene::CopyPosition int  time,
Camera destination
 

Copies the position of the camera that belongs to the scene at a specific time to the camera object passed as a pointer.

Parameters:
time Time at which the position of the camera shall be copied.
destination Camera to which the position shall be copied.

Definition at line 93 of file Scene.cpp.

virtual void Scene::Init  )  [virtual]
 

Abstract function to initialize the scene that has to be implemented by the descendants. This function gets called by the demo to which the scene belongs to.

Reimplemented in GroupCullingScene, LandscapeScene, TestScene, and TorusScene.

void Scene::Monitor int  time,
Camera monitor,
int  culling_mode,
bool  level_of_detail
 

Monitors the scene at any given time using a monitorning camera.

Parameters:
time Time in milliseconds at which the scene shall be rendered.
monitor The camera from which the scene shall be monitored.
culling_mode Determines the mode used for the view frustum culling (C_NONE, C_BOUNDING_BOX, C_SPHERE or C_MIXED).
level_of_detail States wheather level of detail is enabled or not.

Definition at line 55 of file Scene.cpp.

void Scene::NextLightId  )  [private]
 

Sets the 'current_light_id' to the next available OpenGL light identifier, provided that there is one available.

Definition at line 166 of file Scene.cpp.

void Scene::PrintToConsole  ) 
 

Prints information about the scene to the console.

Definition at line 213 of file Scene.cpp.

void Scene::Render int  time,
int  culling_mode,
bool  level_of_detail
 

Renders the scene at any given time.

Parameters:
time Time in milliseconds at which the scene shall be rendered.
culling_mode Determines the mode used for the view frustum culling (C_NONE, C_BOUNDING_BOX, C_SPHERE or C_MIXED).
level_of_detail States wheather level of detail is enabled or not.

Definition at line 26 of file Scene.cpp.

void Scene::TurnOffLights  )  [private]
 

Disables all lights that are not in used by this scene.

Definition at line 190 of file Scene.cpp.


Member Data Documentation

Camera* Scene::camera [protected]
 

The camera that captures the scene.

Definition at line 85 of file Scene.h.

GraphicalObject* Scene::camera_object [private]
 

Camera representation during monitor mode.

Definition at line 100 of file Scene.h.

int Scene::current_light_id [private]
 

Current OpenGL light identifier.

Definition at line 135 of file Scene.h.

LightList* Scene::first_light [private]
 

The list containing the lights.

Definition at line 124 of file Scene.h.

GraphicalObjectList* Scene::first_object [private]
 

The list containing the graphical objects.

Definition at line 97 of file Scene.h.


Generated on Sun Jul 2 13:20:41 2006 for Demo by  doxygen 1.4.6-NO