BodyManager Class Reference
#include <BodyManager.h>
![](../class_body_manager.png)
# 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 | |
![]() | |
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 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) |
![]() | |
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()
Create a body with the provided spec.
- Parameters
-
owner Object to which the body will attach to bodySpec Spec to use to create the body
- Returns
- Created body
Definition at line 87 of file BodyManager.c.
# disable()
|
virtual |
Disable the manager.
Reimplemented from ComponentManager.
Definition at line 80 of file BodyManager.c.
# 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()
|
virtual |
Retrieve the compoment type that the manager manages.
- Returns
- Component type
Implements ComponentManager.
Definition at line 66 of file BodyManager.c.
# print()
Print the manager's statistics.
- Parameters
-
x Screen x coordinate where to print y Screen 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
-
frictionCoefficient Friction 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
-
gravity Gravity 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
-
timeScale Time 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
|
protected |
Cycle of physical simulation during the current second.
Definition at line 45 of file BodyManager.h.
# frictionCoefficient
|
protected |
Friction coefficient in the current physical world.
Definition at line 39 of file BodyManager.h.
# gravity
|
protected |
Gravity in the current physical world.
Definition at line 36 of file BodyManager.h.
# remainingSkipCycles
|
protected |
Number of pending cycles to skip until the next physical simulation cycle.
Definition at line 51 of file BodyManager.h.
# skipCycles
|
protected |
Number of cycles to skip physical simulations to slow down physics.
Definition at line 48 of file BodyManager.h.
# 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:
- VUEngine-Core/source/Component/Body/BodyManager.h
- VUEngine-Core/source/Component/Body/BodyManager.c