Engine
Scene Class Reference

A scene in the engine. More...

#include <scene.h>

Public Member Functions

 Scene ()
 
 Scene (std::shared_ptr< TimeIntegrator > integrator, NetForceAccumulator net_force_accumulator)
 
void AddPhysicsEntity (std::shared_ptr< PhysicsEntity > entity_ptr)
 
void GetPhysicsEntity (const GLuint index, std::shared_ptr< PhysicsEntity > &entity_ptr)
 
void AddModel (std::shared_ptr< Model > model_ptr)
 
void GetModel (const GLuint index, std::shared_ptr< Model > &model_ptr, GLuint &VAO)
 
GLuint GetPhysicsEntityCount ()
 
GLuint GetModelCount ()
 
void AddSpring (Spring spring)
 
void SetLight (Light light)
 
void StepPhysics ()
 
void Render (Shader shader, Vector3Gf view_pos)
 
void CleanUp ()
 

Detailed Description

A scene in the engine.

A scene contains (pointers to) a number of PhysicsEntity objects to simululate and a number of Model objects to render.

Constructor & Destructor Documentation

Scene::Scene ( )

Creates a Scene instance with default values for its TimeIntegrator and ForceGenerator members

Scene::Scene ( std::shared_ptr< TimeIntegrator integrator,
NetForceAccumulator  net_force_accumulator 
)

Creates a Scene instance with the provided TimeIntegrator and ForceGenerator members

Parameters
integratorTimeIngrator instance to handle time evolution of the PhysicsEntities in the scene
net_force_accumulatorNetForceAccumulator used to compute net forces acting on PhysicsEntities in the scene

Member Function Documentation

void Scene::AddModel ( std::shared_ptr< Model model_ptr)

Adds a Model to the scene

Parameters
model_ptra shared pointer to the model to be added to the scene
void Scene::AddPhysicsEntity ( std::shared_ptr< PhysicsEntity entity_ptr)

Add a PhysicsEntity to the Scene.

Parameters
entity_ptra shared pointer to the PhysicsEntity to be added to the scene
void Scene::AddSpring ( Spring  spring)

Adds a spring connecting two entities in the scene

Parameters
springthe spring
void Scene::CleanUp ( )

Removes all Model data from the GPU

void Scene::GetModel ( const GLuint  index,
std::shared_ptr< Model > &  model_ptr,
GLuint &  VAO 
)

Loads the Model at the given index into the supplied shared pointer

Parameters
indexindex into the Model list for this Scene
model_ptrpointer that will be modifed to point to the Model at the given index
VAOuint that will be modifed to store the vertex array object id for the Model
GLuint Scene::GetModelCount ( )
Returns
The number of Models in the Scene
void Scene::GetPhysicsEntity ( const GLuint  index,
std::shared_ptr< PhysicsEntity > &  entity_ptr 
)

Loads the PhysicsEntity at the given index into the supplied shared pointer

Parameters
indexindex into the PhysicsEntity list for this Scene
entity_ptrpointer that will be modified to point to the PhysicsEntity at the given index
GLuint Scene::GetPhysicsEntityCount ( )
Returns
The number of Physics Entites in the Scene
void Scene::Render ( Shader  shader,
Vector3Gf  view_pos 
)

Renders the Models in the Scene to the screen

Parameters
shadershader to use to render scene
view_posposition scene is being viewed from
void Scene::SetLight ( Light  light)

Sets the light for the scene

Parameters
lightthe light source
void Scene::StepPhysics ( )

Moves the physical simulation one time step forward


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