BodyManager Class Reference

#include <BodyManager.h>

Inheritance diagram for BodyManager:
ComponentManager

# Public Member Functions

void constructor ()
 Class' constructor.
override uint32 getType ()
override void enable ()
 Enable the manager.
override void disable ()
 Disable the manager.
override Body create (Entity owner, const BodySpec *bodySpec)
void reset ()
 Reset the manager's state.
void update ()
 Update the registered bodies by advancing the physics simulations.
void setTimeScale (fixed_t timeScale)
uint32 getTimeScale ()
void setGravity (Vector3D gravity)
Vector3D getGravity ()
void setFrictionCoefficient (fixed_t frictionCoefficient)
fixed_t getFrictionCoefficient ()
void print (int32 x, int32 y)

# Protected Attributes

Vector3D gravity
 Gravity in the current physical world.
fixed_t frictionCoefficient
 Friction coefficient in the current physical world.
fixed_t timeScale
 Time scale for time step on each call to update.
uint8 cycle
 Cycle of physical simulation during the current second.
uint8 skipCycles
 Number of cycles to skip physical simulations to slow down physics.
uint8 remainingSkipCycles
 Number of pending cycles to skip until the next physical simulation cycle.

# Additional Inherited Members

- Private Member Functions inherited from ComponentManager
void constructor ()
 Class' constructor.
void destroyAllComponents ()
 Destroy all the manager's components.
virtual Component create (Entity owner, const ComponentSpec *componentSpec)=0
virtual void purgeComponents ()
 Force the purging of deleted components.
virtual bool areComponentsVisual ()
- Static Private Member Functions inherited from ComponentManager
static Component createComponent (Entity owner, const ComponentSpec *componentSpec)
static void destroyComponent (Entity owner, Component component)
static Component addComponent (Entity owner, const ComponentSpec *componentSpec)
static void removeComponent (Entity owner, Component component)
static void addComponents (Entity owner, ComponentSpec **componentSpecs, uint32 componentType)
static void removeComponents (Entity owner, uint32 componentType)
static void createComponents (Entity owner, ComponentSpec **componentSpecs)
static void destroyComponents (Entity owner)
static Component getComponentAtIndex (Entity owner, uint32 componentType, int16 componentIndex)
static void getComponents (Entity owner, uint32 componentType, VirtualList components)
static bool getComponentsOfClass (Entity owner, ClassPointer classPointer, VirtualList components, uint32 componentType)
static uint16 getComponentsCount (Entity owner, uint32 componentType)
static void propagateCommand (int32 command, Entity owner, uint32 componentType,...)
static bool calculateRightBox (Entity owner, RightBox *rightBox)
- Private Attributes inherited from ComponentManager
VirtualList components
 List of components.
bool locked
 Flag to prevent the manipulation of the components list.

# Detailed Description

Class BodyManager

Inherits from ComponentManager

Manages the physical bodies in the game states.

Definition at line 31 of file BodyManager.h.

# Member Function Documentation

# constructor()

void BodyManager::constructor ( )

Class' constructor.

Definition at line 37 of file BodyManager.c.

# create()

Body BodyManager::create ( Entity owner,
const BodySpec * bodySpec )

Create a body with the provided spec.

Parameters
ownerObject to which the body will attach to
bodySpecSpec to use to create the body
Returns
Created body

Definition at line 87 of file BodyManager.c.

# disable()

void BodyManager::disable ( )
virtual

Disable the manager.

Reimplemented from ComponentManager.

Definition at line 80 of file BodyManager.c.

# enable()

void BodyManager::enable ( )
virtual

Enable the manager.

Reimplemented from ComponentManager.

Definition at line 73 of file BodyManager.c.

# getFrictionCoefficient()

fixed_t BodyManager::getFrictionCoefficient ( )

Retrieve the physical world's friction coefficient.

Returns
Friction coefficient to set in the current physical world

Definition at line 256 of file BodyManager.c.

# getGravity()

Vector3D BodyManager::getGravity ( )

Retrieve the physical world's gravity.

Returns
Gravity in the current physical world

Definition at line 240 of file BodyManager.c.

# getTimeScale()

uint32 BodyManager::getTimeScale ( )

Retrieve the time scale for time step on each call to update.

Returns
Time scale for time step on each call to update

Definition at line 224 of file BodyManager.c.

# getType()

uint32 BodyManager::getType ( )
virtual

Retrieve the compoment type that the manager manages.

Returns
Component type

Implements ComponentManager.

Definition at line 66 of file BodyManager.c.

# print()

void BodyManager::print ( int32 x,
int32 y )

Print the manager's statistics.

Parameters
xScreen x coordinate where to print
yScreen y coordinate where to print

Definition at line 270 of file BodyManager.c.

# reset()

void BodyManager::reset ( )

Reset the manager's state.

Definition at line 99 of file BodyManager.c.

# setFrictionCoefficient()

void BodyManager::setFrictionCoefficient ( fixed_t frictionCoefficient)

Set the physical world's friction coefficient.

Parameters
frictionCoefficientFriction coefficient to set in the current physical world

Definition at line 247 of file BodyManager.c.

# setGravity()

void BodyManager::setGravity ( Vector3D gravity)

Set the physical world's gravity.

Parameters
gravityGravity to set in the current physical world

Definition at line 231 of file BodyManager.c.

# setTimeScale()

void BodyManager::setTimeScale ( fixed_t timeScale)

Set the time scale for time step on each call to update.

Parameters
timeScaleTime scale for time step on each call to update

Definition at line 189 of file BodyManager.c.

# update()

void BodyManager::update ( )

Update the registered bodies by advancing the physics simulations.

Definition at line 106 of file BodyManager.c.

# Member Data Documentation

# cycle

uint8 BodyManager::cycle
protected

Cycle of physical simulation during the current second.

Definition at line 45 of file BodyManager.h.

# frictionCoefficient

fixed_t BodyManager::frictionCoefficient
protected

Friction coefficient in the current physical world.

Definition at line 39 of file BodyManager.h.

# gravity

Vector3D BodyManager::gravity
protected

Gravity in the current physical world.

Definition at line 36 of file BodyManager.h.

# remainingSkipCycles

uint8 BodyManager::remainingSkipCycles
protected

Number of pending cycles to skip until the next physical simulation cycle.

Definition at line 51 of file BodyManager.h.

# skipCycles

uint8 BodyManager::skipCycles
protected

Number of cycles to skip physical simulations to slow down physics.

Definition at line 48 of file BodyManager.h.

# timeScale

fixed_t BodyManager::timeScale
protected

Time scale for time step on each call to update.

Definition at line 42 of file BodyManager.h.


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