i6engine  1.0
i6e::modules::PhysicsManager Class Reference

#include <D:/Projekte/i6engine/libs/i6engine-modules/include/i6engine/modules/physics/PhysicsManager.h>

Public Member Functions

 PhysicsManager (PhysicsController *pc)
 constructor More...
 
 ~PhysicsManager ()
 destructor More...
 
void NewsCreate (const api::GameMessage::Ptr &msg)
 handles create messages for the PhysicsManager More...
 
void NewsUpdate (const api::GameMessage::Ptr &msg)
 handles update messages for the PhysicsManager More...
 
void NewsDelete (const api::GameMessage::Ptr &msg)
 handles delete messages for the PhysicsManager More...
 
void Tick ()
 Ticks physics stuff. More...
 
btCompoundShape * createCompound ()
 Creates a new CompoundShape. More...
 
btCollisionShape * createSphere (const api::attributeMap &params)
 Creates a new RigidBody with a sphere collisionShape. More...
 
btCollisionShape * createFromFile (const api::attributeMap &params)
 Creates a new RigidBody from a collisionShape from a file. More...
 
btCollisionShape * createBox (const api::attributeMap &params)
 Creates a new RigidBody with a box collisionShape. More...
 
btCollisionShape * createPlane (const api::attributeMap &params)
 Creates a new RigidBody with a planes collisionShape. More...
 
btCollisionShape * createEmptyShape ()
 creates an empty default shape More...
 
void remove (btRigidBody *body)
 Deletes a body's collisionShape and removes it from the PhysicsShapeController::_collisionShapes array. More...
 
void removeShape (btCollisionShape *shape)
 
btDynamicsWorld * getPhysicsWorld () const
 
void setGravity (const Vec3 &gravity)
 Sets the gravity of the world. More...
 
void setGravity (const double gravityDown)
 Sets the gravity of the world. More...
 
void addRigidBody (btRigidBody *rigidBody)
 Adds the body to the world for simulation. More...
 
void removeRigidBody (btRigidBody *rigidBody)
 Removes the body from the world to stop simulation. More...
 
PhysicsNodegetPhysicsNode (const int64_t id)
 returns the PhysicsNode with the given ID More...
 
void addTicker (PhysicsNode *pn)
 adds a ticking PhysicsNode More...
 
void removeTicker (PhysicsNode *pn)
 removes a ticking PhysicsNode More...
 

Static Public Attributes

static std::map< std::pair< PhysicsNode *, PhysicsNode * >, uint64_t > _collisionPairs
 stores all collision pairs More...
 
static uint64_t _tickCount
 counts ticks for this subsystem More...
 

Detailed Description

Definition at line 55 of file PhysicsManager.h.

Constructor & Destructor Documentation

i6e::modules::PhysicsManager::PhysicsManager ( PhysicsController pc)
explicit

constructor

i6e::modules::PhysicsManager::~PhysicsManager ( )

destructor

Member Function Documentation

void i6e::modules::PhysicsManager::addRigidBody ( btRigidBody *  rigidBody)

Adds the body to the world for simulation.

void i6e::modules::PhysicsManager::addTicker ( PhysicsNode pn)

adds a ticking PhysicsNode

btCollisionShape* i6e::modules::PhysicsManager::createBox ( const api::attributeMap params)

Creates a new RigidBody with a box collisionShape.

Parameters
[in]motionState
[in]paramsattributeMap containing all values set for box
btCompoundShape* i6e::modules::PhysicsManager::createCompound ( )

Creates a new CompoundShape.

btCollisionShape* i6e::modules::PhysicsManager::createEmptyShape ( )

creates an empty default shape

btCollisionShape* i6e::modules::PhysicsManager::createFromFile ( const api::attributeMap params)

Creates a new RigidBody from a collisionShape from a file.

Parameters
[in]motionState
[in]paramsattributeMap containing all values set for file
btCollisionShape* i6e::modules::PhysicsManager::createPlane ( const api::attributeMap params)

Creates a new RigidBody with a planes collisionShape.

Parameters
[in]motionState
[in]paramsattributeMap containing all values set for plane
btCollisionShape* i6e::modules::PhysicsManager::createSphere ( const api::attributeMap params)

Creates a new RigidBody with a sphere collisionShape.

Parameters
[in]motionState
[in]paramsattributeMap containing all values set for sphere
PhysicsNode* i6e::modules::PhysicsManager::getPhysicsNode ( const int64_t  id)

returns the PhysicsNode with the given ID

btDynamicsWorld* i6e::modules::PhysicsManager::getPhysicsWorld ( ) const
Returns
the dynamic world
void i6e::modules::PhysicsManager::NewsCreate ( const api::GameMessage::Ptr msg)

handles create messages for the PhysicsManager

void i6e::modules::PhysicsManager::NewsDelete ( const api::GameMessage::Ptr msg)

handles delete messages for the PhysicsManager

void i6e::modules::PhysicsManager::NewsUpdate ( const api::GameMessage::Ptr msg)

handles update messages for the PhysicsManager

void i6e::modules::PhysicsManager::remove ( btRigidBody *  body)

Deletes a body's collisionShape and removes it from the PhysicsShapeController::_collisionShapes array.

Parameters
[in]bodythe RigidBody to be deleted
void i6e::modules::PhysicsManager::removeRigidBody ( btRigidBody *  rigidBody)

Removes the body from the world to stop simulation.

void i6e::modules::PhysicsManager::removeShape ( btCollisionShape *  shape)
void i6e::modules::PhysicsManager::removeTicker ( PhysicsNode pn)

removes a ticking PhysicsNode

void i6e::modules::PhysicsManager::setGravity ( const Vec3 gravity)

Sets the gravity of the world.

Parameters
[in]gravityThe "force" direction. The usual gravity is (0, -y, 0) where -y is the value of the desired gravity (9.8 in rl)
void i6e::modules::PhysicsManager::setGravity ( const double  gravityDown)

Sets the gravity of the world.

Parameters
[in]gravityDownSets gravity to (0, -gravityDown, 0).
void i6e::modules::PhysicsManager::Tick ( )

Ticks physics stuff.

Member Data Documentation

std::map<std::pair<PhysicsNode *, PhysicsNode *>, uint64_t> i6e::modules::PhysicsManager::_collisionPairs
static

stores all collision pairs

Definition at line 60 of file PhysicsManager.h.

uint64_t i6e::modules::PhysicsManager::_tickCount
static

counts ticks for this subsystem

Definition at line 65 of file PhysicsManager.h.


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