Main Page | Namespace List | Class Hierarchy | Class List | File List | Class Members | File Members | Related Pages

Universe Class Reference

Universe. More...

#include <S2_Universe.h>

List of all members.

Public Member Functions

 Universe ()
virtual ~Universe ()
Universe Creation and Destruction.
void BigBang (unsigned int max_obj=S2_UNIVERSE_DEFAULT_MAX_OBJ)
void BigCrunch ()
System creation, destruction and configuration.
SystemCreateSystem ()
void DestroySystem (System *p_sys)
System creation and destruction.
ObjectCreateObject (Model::ModelType natural_model_type, System *natural_sys=NULL)
void DestroyObject (Object *p_obj)
unsigned int GetNumObjects () const
unsigned int GetNumSystems () const
Simulation methods
void Update (Real dt)

Private Member Functions

Memory allocation related methods
ObjectAllocObject ()
void DeallocObject (Object *p_obj)

Private Attributes

UniverseID m_id
std::vector< System * > m_vecSystems
std::vector< Objectm_vecObjects
std::list< Object * > m_listFreeObjects
 Objects unattached to any.

Detailed Description


Represents a closed universe inhabited by animated objects.

Contains a set of Objects organized into Systems for their simulation and offers methods to create and manipulate them.

The Universe is the highest level of the collision detection test between Object geometries/shapes. Anything in a Universe can collide with everything else, except for disabled Objects/Systems/groups.


Constructor & Destructor Documentation

BEGIN_NAMESPACE_S2 Universe::Universe  ) 

Universe::~Universe  )  [virtual]

Member Function Documentation

Object * Universe::AllocObject  )  [private]

void Universe::BigBang unsigned int  max_obj = S2_UNIVERSE_DEFAULT_MAX_OBJ  ) 

Experienced god required, candidates send CV to

void Universe::BigCrunch  ) 

Goodbye cruel world...

Object * Universe::CreateObject Model::ModelType  natural_model_type,
System natural_sys = NULL

Creates a new Object in the Universe.

natural_model_type: Natural/preferred type of Model that will be used in the Object animation.
natural_sys: The system in which the object/model is inserted and simulated. If NULL, the Object will be considered completely free/uncoupled with any other object and therefore updated locally.

How do we create app-defined-models?? it should be something like:

System * Universe::CreateSystem  ) 

Creates a new System in the Universe.

void Universe::DeallocObject Object p_obj  )  [private]

void Universe::DestroyObject Object p_obj  ) 

Destroys an Object.

What happens with the attached Shape, Controllers, Interactions, etc... ?

Notify the System in which it's being simulated

void Universe::DestroySystem System p_sys  ) 

Destroys a System in a Universe.

What happens with the objects/models inside the system ?

unsigned int Universe::GetNumObjects  )  const

unsigned int Universe::GetNumSystems  )  const

void Universe::Update Real  dt  ) 

Advances a timestep of dt for all the Objects currently simulated in this Universe.

Member Data Documentation

UniverseID Universe::m_id [private]

std::list<Object *> Universe::m_listFreeObjects [private]

Objects unattached to any.

std::vector<Object> Universe::m_vecObjects [private]

std::vector<System *> Universe::m_vecSystems [private]

The documentation for this class was generated from the following files:
Generated on Tue Aug 10 15:58:31 2004 for Saphyre2 by doxygen 1.3.5