MezzanineEngine 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Friends | List of all members
Mezzanine::Physics::PhysicsManager Class Reference

This is simply a place for storing all the Physics Related functions. More...

#include <physicsmanager.h>

+ Inheritance diagram for Mezzanine::Physics::PhysicsManager:
+ Collaboration diagram for Mezzanine::Physics::PhysicsManager:

Public Types

typedef std::map
< CollidablePair, Collision * > 
CollisionContainer
 Basic container type for Collision storage by this class.
 
typedef
CollisionContainer::iterator 
CollisionIterator
 Iterator type for Collision instances stored by this class.
 
typedef std::pair
< CollidablePair, Collision * > 
CollisionSortPair
 A std::pair to assist with collision sorting operations.
 
typedef
CollisionContainer::const_iterator 
ConstCollisionIterator
 Const Iterator type for Collision instances stored by this class.
 
typedef
ConstraintContainer::const_iterator 
ConstConstraintIterator
 Const Iterator type for Constraint instances stored by this class.
 
typedef
ProxyContainer::const_iterator 
ConstProxyIterator
 Const Iterator type for CollidableProxy instances stored by this class.
 
typedef std::vector< Constraint * > ConstraintContainer
 Basic container type for Constraint storage by this class.
 
typedef
ConstraintContainer::iterator 
ConstraintIterator
 Iterator type for Constraint instances stored by this class.
 
typedef
WorldTriggerContainer::const_iterator 
ConstWorldTriggerIterator
 Const Iterator type for WorldTrigger instances stored by this class.
 
typedef std::vector
< CollidableProxy * > 
ProxyContainer
 Basic container type for CollidableProxy storage by this class.
 
typedef ProxyContainer::iterator ProxyIterator
 Iterator type for CollidableProxy instances stored by this class.
 
typedef std::vector
< WorldTrigger * > 
WorldTriggerContainer
 Basic container type for WorldTrigger storage by this class.
 
typedef
WorldTriggerContainer::iterator 
WorldTriggerIterator
 Iterator type for WorldTrigger instances stored by this class.
 

Public Member Functions

 PhysicsManager ()
 Simple Constructor. More...
 
 PhysicsManager (const ManagerConstructionInfo &Info)
 Simple Constructor. More...
 
 PhysicsManager (XML::Node &XMLNode)
 XML constructor. More...
 
virtual ~PhysicsManager ()
 Deconstructor. More...
 
btSoftRigidDynamicsWorld * _GetPhysicsWorldPointer ()
 This returns a pointer to the bullet physics world. This is for internal use only. More...
 
const btSoftRigidDynamicsWorld * _GetPhysicsWorldPointer () const
 This returns a pointer to the bullet physics world. This is for internal use only. More...
 
void AddConstraint (Physics::Constraint *Con, bool DisableCollisions=false)
 Adds a constraint to the world. More...
 
void AddWorldTrigger (WorldTrigger *Trig)
 Adds a trigger to the world. More...
 
CollisionIterator BeginCollision ()
 Get an CollisionIterator to the first Collision. More...
 
ConstCollisionIterator BeginCollision () const
 Get a ConstCollisionIterator to the first Collision. More...
 
void ClearPhysicsMetaData ()
 Clears all data relating to actors and other simulation objects from the physics world. More...
 
GhostProxyCreateGhostProxy ()
 Creates a new GhostProxy. More...
 
GhostProxyCreateGhostProxy (const XML::Node &SelfRoot)
 Creates a new GhostProxy. More...
 
RigidProxyCreateRigidProxy (const Real Mass)
 Creates a new RigidProxy. More...
 
RigidProxyCreateRigidProxy (const XML::Node &SelfRoot)
 Creates a new RigidProxy. More...
 
SoftProxyCreateSoftProxy (const Real Mass)
 Creates a new SoftProxy. More...
 
SoftProxyCreateSoftProxy (const XML::Node &SelfRoot)
 Creates a new SoftProxy. More...
 
virtual void Deinitialize ()
 Removes this manager from any necessary configuration so it can be safely disposed of. More...
 
void DestroyAllCollisions ()
 Destroys all collisions currently being stored and processed in the manager.
 
void DestroyAllConstraints ()
 Destroys all constraints currently in the manager. More...
 
void DestroyAllProxies ()
 Deletes all stored CollidableProxy instances.
 
void DestroyAllWorldTriggers ()
 Destroys all triggers currently in the manager.
 
void DestroyProxy (CollidableProxy *ToBeDestroyed)
 Deletes a CollidableProxy. More...
 
CollisionIterator EndCollision ()
 Get a CollisionIterator to one past the last Collision. More...
 
ConstCollisionIterator EndCollision () const
 Get a ConstCollisionIterator to one past the last Collision. More...
 
Physics::CollisionGetCollision (CollidablePair *Pair)
 Gets a Collision by collidable pair. More...
 
Physics::ConstraintGetConstraint (const Whole &Index)
 Gets a constraint by index. More...
 
DebugDrawWorkUnitGetDebugDrawWork ()
 Gets a pointer to the work unit that updates the debug drawer. More...
 
Integer GetDebugRenderingMode () const
 Is Physics Debug Drawing currently enabled? More...
 
virtual String GetImplementationTypeName () const
 This Allows any manager name to be sent to a stream. Primarily used for logging. More...
 
virtual ManagerType GetInterfaceType () const
 This returns the type of this manager. More...
 
Whole GetNumCollisions ()
 Gets the number of Collisions currently in the world. More...
 
Whole GetNumConstraints ()
 Gets the number of constraints currently in the world. More...
 
UInt32 GetNumProxies () const
 Gets the number of CollidableProxy instances in this manager. More...
 
Whole GetNumWorldTriggers ()
 Gets the number of triggers currently in the world. More...
 
CollidableProxyGetProxy (const UInt32 Index) const
 Gets a CollidableProxy instance by index. More...
 
Threading::DefaultWorkUnitGetSimulationWork ()
 Gets a pointer to the work unit that steps the simulation. More...
 
Vector3 GetWorldGravity ()
 Gets the gravity. More...
 
Vector3 GetWorldSoftGravity ()
 Gets the soft body gravity. More...
 
WorldTriggerGetWorldTrigger (const String &Name)
 Gets a trigger by name. More...
 
WorldTriggerGetWorldTrigger (const Whole &Index)
 Gets a trigger by index. More...
 
WorldTriggerUpdateWorkUnitGetWorldTriggerUpdateWork ()
 Gets a pointer to the work unit that updates all WorldTriggers. More...
 
virtual void Initialize ()
 Configures this manager for use prior to entering the main loop. More...
 
void MainLoopInitialize ()
 Does all of the necessary configuration to prepare for a running simulation.
 
virtual void Pause (const UInt32 PL)
 Sets the pause state of this manager, or has no effect depending on the value passed in. More...
 
void PauseSimulation (bool Pause)
 Pauses the simulation, preventing the physics world from taking action. More...
 
void RemoveCollision (Physics::Collision *Col)
 Removes an existing collision from the world. More...
 
void RemoveCollisionsContainingProxy (CollidableProxy *Proxy)
 Removes all stored collisions that involve the specified CollidableProxy. More...
 
void RemoveConstraint (Physics::Constraint *Con)
 Removes a constraint from the world. More...
 
void RemoveWorldTrigger (WorldTrigger *Trig)
 Removes a trigger from the world. More...
 
void ResetPhysicsWorld (ManagerConstructionInfo *Info=0)
 Resets all the internal physics structures in this manager. More...
 
void SetDebugRenderingMode (const Integer DebugRenderingMode)
 Enables and Disables Physics Debug Drawing. More...
 
void SetSimulationSubstepModifier (const Whole &Modifier)
 Sets the modifier to be used when stepping the physics simulation. More...
 
void SetWorldGravity (const Vector3 &pgrav)
 Sets the gravity. More...
 
void SetWorldSoftGravity (const Vector3 &sgrav)
 Sets the gravity for soft bodies. More...
 
bool SimulationIsPaused ()
 Gets Whether or not the simulation is currently paused. More...
 
- Public Member Functions inherited from Mezzanine::WorldManager
 WorldManager ()
 Class constructor.
 
virtual ~WorldManager ()
 Class destructor.
 
virtual void _SetWorld (World *Parent)
 Sets the world this manager belongs to.

Exceptions
Ifthis manager is already initialized, this method will throw an "INVALID_STATE_EXCEPTION".
More...
 
virtual WorldGetWorld () const
 Gets the world this manager belongs to. More...
 
virtual bool IsPaused () const
 Gets whether or not this manager is currently paused. More...
 
- Public Member Functions inherited from Mezzanine::ManagerBase
 ManagerBase ()
 Class constructor.
 
virtual ~ManagerBase ()
 Class destructor.
 
virtual String GetInterfaceTypeAsString () const
 Gets a string of the interface type of this manager. More...
 
bool IsInitialized () const
 Gets whether or not this manager has been initialized. More...
 

Protected Member Functions

virtual void Construct (const ManagerConstructionInfo &Info)
 This takes care of all the real work in contructing this. More...
 
virtual void Destroy ()
 Tear down this physics world.
 
virtual void ProcessAllCollisions ()
 Checks the internal collision data and generates/updates collisions as necessary. More...
 
virtual void ProcessAllTriggers ()
 Calls the ConditionsAreMet() and ApplyTrigger() functions of every stored trigger. More...
 

Static Protected Member Functions

static void InternalTickCallback (btDynamicsWorld *world, btScalar timeStep)
 Internal Callback that is called each substep of the simulation.
 

Protected Attributes

btBroadphaseInterface * BulletBroadphase
 
btCollisionConfiguration * BulletCollisionConfiguration
 
btCollisionDispatcher * BulletDispatcher
 
btThreadSupportInterface * BulletDispatcherThreads
 
debug::InternalDebugDrawerBulletDrawer
 
btSoftRigidDynamicsWorld * BulletDynamicsWorld
 
btSequentialImpulseConstraintSolver * BulletSolver
 
btThreadSupportInterface * BulletSolverThreads
 
CollisionContainer Collisions
 
ConstraintContainer Constraints
 
DebugDrawWorkUnitDebugDrawWork
 The work unit that updates the debug drawer with the latest physics rendering. More...
 
Integer DebugRenderMode
 
btGhostPairCallback * GhostCallback
 
ProxyContainer Proxies
 
bool SimulationPaused
 
Threading::DefaultWorkUnitSimulationWork
 The work unit that does the stepping of the simulation. More...
 
Real StepSize
 
Whole SubstepModifier
 
Whole ThreadCount
 
Threading::DefaultThreadSpecificStorage::TypeThreadResources
 Can be used for thread safe logging and other thread specific resources. More...
 
WorldTriggerContainer Triggers
 
ManagerConstructionInfo WorldConstructionInfo
 
WorldTriggerUpdateWorkUnitWorldTriggerUpdateWork
 The work unit that processes all world triggers. More...
 
- Protected Attributes inherited from Mezzanine::WorldManager
bool OperationsPaused
 This stores whether or not processing for some or all objects in this manager has been paused. More...
 
WorldParentWorld
 A pointer to the world that created this manager. More...
 
- Protected Attributes inherited from Mezzanine::ManagerBase
bool Initialized
 Simple bool indicating whether or not this manager has been initialized. More...
 
EntresolTheEntresol
 The actual pointer to the Entresol core class. More...
 

Friends

class CollisionDispatcher
 
class DebugDrawWorkUnit
 
class ParallelCollisionDispatcher
 
class SimulationMonopolyWorkUnit
 
class SimulationWorkUnit
 
class WorldTriggerUpdateWorkUnit
 

Additional Inherited Members

- Static Public Member Functions inherited from Mezzanine::ManagerBase
static String GetTypeAsString (const ManagerType &ManagerType)
 Gets the string form of the type of manager. More...
 
static ManagerType GetTypeFromString (const String &ManagerName)
 Gets the type of manager requested from a string. More...
 

Detailed Description

This is simply a place for storing all the Physics Related functions.

This is a place for storing items related to Debug physics drawing, Adding constraints, screwing with gravity and doing other physics Related features.

Definition at line 236 of file physicsmanager.h.

Constructor & Destructor Documentation

Mezzanine::Physics::PhysicsManager::PhysicsManager ( )

Simple Constructor.

This constructor will assign some sane default values and will create a physics world that can be used immediately

Definition at line 374 of file physicsmanager.cpp.

Mezzanine::Physics::PhysicsManager::PhysicsManager ( const ManagerConstructionInfo Info)

Simple Constructor.

This constructor will assign some sane default values and will create a physics world that can be used immediately

Parameters
InfoThe construction info class with all the settings you wish the world to have.

Definition at line 401 of file physicsmanager.cpp.

Mezzanine::Physics::PhysicsManager::PhysicsManager ( XML::Node XMLNode)

XML constructor.

Parameters
XMLNodeThe node of the xml document to construct from.

Definition at line 426 of file physicsmanager.cpp.

Mezzanine::Physics::PhysicsManager::~PhysicsManager ( )
virtual

Deconstructor.

This deletes all those crazy pointers that Bullet, the physics subsystem need.

Definition at line 506 of file physicsmanager.cpp.

Member Function Documentation

btSoftRigidDynamicsWorld * Mezzanine::Physics::PhysicsManager::_GetPhysicsWorldPointer ( )

This returns a pointer to the bullet physics world. This is for internal use only.

Definition at line 1234 of file physicsmanager.cpp.

const btSoftRigidDynamicsWorld * Mezzanine::Physics::PhysicsManager::_GetPhysicsWorldPointer ( ) const

This returns a pointer to the bullet physics world. This is for internal use only.

Definition at line 1237 of file physicsmanager.cpp.

void Mezzanine::Physics::PhysicsManager::AddConstraint ( Physics::Constraint Con,
bool  DisableCollisions = false 
)

Adds a constraint to the world.

Adds the constraint to the world so that it can/will take effect.

Parameters
ConThe constraint to be added.
DisableCollisionsSets whether or not the linked bodies collide with each other.

Definition at line 882 of file physicsmanager.cpp.

void Mezzanine::Physics::PhysicsManager::AddWorldTrigger ( WorldTrigger Trig)

Adds a trigger to the world.

Adds a trigger to the world so that it can/will take effect.

Parameters
TrigThe trigger to be added.

Definition at line 924 of file physicsmanager.cpp.

PhysicsManager::CollisionIterator Mezzanine::Physics::PhysicsManager::BeginCollision ( )

Get an CollisionIterator to the first Collision.

Returns
An CollisionIterator to the first Collision.

Definition at line 1030 of file physicsmanager.cpp.

PhysicsManager::ConstCollisionIterator Mezzanine::Physics::PhysicsManager::BeginCollision ( ) const

Get a ConstCollisionIterator to the first Collision.

Returns
A ConstCollisionIterator to the first Collision.

Definition at line 1040 of file physicsmanager.cpp.

void Mezzanine::Physics::PhysicsManager::ClearPhysicsMetaData ( )

Clears all data relating to actors and other simulation objects from the physics world.

This is best used with simulation cleanup.

Definition at line 1082 of file physicsmanager.cpp.

void Mezzanine::Physics::PhysicsManager::Construct ( const ManagerConstructionInfo Info)
protectedvirtual

This takes care of all the real work in contructing this.

This method is called by all the constructors to insure consistent behavior.

Parameters
InfoThe construction info class with all the settings you wish the world to have.

Definition at line 525 of file physicsmanager.cpp.

GhostProxy * Mezzanine::Physics::PhysicsManager::CreateGhostProxy ( )

Creates a new GhostProxy.

Returns
Returns a pointer to the created proxy.

Definition at line 799 of file physicsmanager.cpp.

GhostProxy * Mezzanine::Physics::PhysicsManager::CreateGhostProxy ( const XML::Node SelfRoot)

Creates a new GhostProxy.

Parameters
SelfRootAn XML::Node containing the data to populate this class with.
Returns
Returns a pointer to the created proxy.

Definition at line 806 of file physicsmanager.cpp.

RigidProxy * Mezzanine::Physics::PhysicsManager::CreateRigidProxy ( const Real  Mass)

Creates a new RigidProxy.

Parameters
MassThe mass of the new proxy.
Returns
Returns a pointer to the created proxy.

Definition at line 813 of file physicsmanager.cpp.

RigidProxy * Mezzanine::Physics::PhysicsManager::CreateRigidProxy ( const XML::Node SelfRoot)

Creates a new RigidProxy.

Parameters
SelfRootAn XML::Node containing the data to populate this class with.
Returns
Returns a pointer to the created proxy.

Definition at line 820 of file physicsmanager.cpp.

SoftProxy * Mezzanine::Physics::PhysicsManager::CreateSoftProxy ( const Real  Mass)

Creates a new SoftProxy.

Parameters
MassThe total mass of the new proxy.
Returns
Returns a pointer to the created proxy.

Definition at line 827 of file physicsmanager.cpp.

SoftProxy * Mezzanine::Physics::PhysicsManager::CreateSoftProxy ( const XML::Node SelfRoot)

Creates a new SoftProxy.

Parameters
SelfRootAn XML::Node containing the data to populate this class with.
Returns
Returns a pointer to the created proxy.

Definition at line 834 of file physicsmanager.cpp.

void Mezzanine::Physics::PhysicsManager::Deinitialize ( )
virtual

Removes this manager from any necessary configuration so it can be safely disposed of.

Implements Mezzanine::ManagerBase.

Definition at line 1177 of file physicsmanager.cpp.

void Mezzanine::Physics::PhysicsManager::DestroyAllConstraints ( )

Destroys all constraints currently in the manager.

In practice it is cleaner to remove constraints from the world before removing any constrained actors.

Definition at line 911 of file physicsmanager.cpp.

void Mezzanine::Physics::PhysicsManager::DestroyProxy ( CollidableProxy ToBeDestroyed)

Deletes a CollidableProxy.

Parameters
ToBeDestroyedA pointer to the CollidableProxy you want deleted.

Definition at line 850 of file physicsmanager.cpp.

PhysicsManager::CollisionIterator Mezzanine::Physics::PhysicsManager::EndCollision ( )

Get a CollisionIterator to one past the last Collision.

Returns
A CollisionIterator to one past the last Collision.

Definition at line 1035 of file physicsmanager.cpp.

PhysicsManager::ConstCollisionIterator Mezzanine::Physics::PhysicsManager::EndCollision ( ) const

Get a ConstCollisionIterator to one past the last Collision.

Returns
A ConstCollisionIterator to one past the last Collision.

Definition at line 1045 of file physicsmanager.cpp.

Physics::Collision * Mezzanine::Physics::PhysicsManager::GetCollision ( CollidablePair Pair)

Gets a Collision by collidable pair.

Parameters
PairA pair of CollidableProxies.
Returns
Returns a pointer to the Collision if a collision for the provided pair exists, NULL otherwise.

Definition at line 973 of file physicsmanager.cpp.

Physics::Constraint * Mezzanine::Physics::PhysicsManager::GetConstraint ( const Whole Index)

Gets a constraint by index.

Parameters
IndexThe index of the constraint you want.
Returns
Returns a pointer to the specified constraint.

Definition at line 888 of file physicsmanager.cpp.

DebugDrawWorkUnit * Mezzanine::Physics::PhysicsManager::GetDebugDrawWork ( )

Gets a pointer to the work unit that updates the debug drawer.

Returns
Returns a pointer to the DebugDrawWorkUnit used by this manager.

Definition at line 1217 of file physicsmanager.cpp.

Integer Mezzanine::Physics::PhysicsManager::GetDebugRenderingMode ( ) const

Is Physics Debug Drawing currently enabled?

lets you check if Physics Debug Drawing is enabled or not.

Returns
1 for it is on, and 0 for it is not. The may be other options later for selectively cnacking certain features

Definition at line 1061 of file physicsmanager.cpp.

String Mezzanine::Physics::PhysicsManager::GetImplementationTypeName ( ) const
virtual

This Allows any manager name to be sent to a stream. Primarily used for logging.

Returns
This returns a String that contains the name.

Implements Mezzanine::ManagerBase.

Definition at line 1228 of file physicsmanager.cpp.

ManagerBase::ManagerType Mezzanine::Physics::PhysicsManager::GetInterfaceType ( ) const
virtual

This returns the type of this manager.

This is intended to make using and casting from Manager base easier. With this is is possible to cast from ManagerBase to the correct Manager Type.

Returns
This returns a ManagerTypeName to identify what this can be safely cast to.

Implements Mezzanine::ManagerBase.

Definition at line 1225 of file physicsmanager.cpp.

Whole Mezzanine::Physics::PhysicsManager::GetNumCollisions ( )

Gets the number of Collisions currently in the world.

Returns
Returns a whole representing the number of Collisions in the world.

Definition at line 980 of file physicsmanager.cpp.

Whole Mezzanine::Physics::PhysicsManager::GetNumConstraints ( )

Gets the number of constraints currently in the world.

Returns
Returns a whole representing the number of constraints in the world.

Definition at line 893 of file physicsmanager.cpp.

UInt32 Mezzanine::Physics::PhysicsManager::GetNumProxies ( ) const

Gets the number of CollidableProxy instances in this manager.

Returns
Returns a UInt32 representing the number of CollidableProxy instances contained in this manager.

Definition at line 847 of file physicsmanager.cpp.

Whole Mezzanine::Physics::PhysicsManager::GetNumWorldTriggers ( )

Gets the number of triggers currently in the world.

Returns
Returns a whole representing the number of triggers in the world.

Definition at line 946 of file physicsmanager.cpp.

CollidableProxy * Mezzanine::Physics::PhysicsManager::GetProxy ( const UInt32  Index) const

Gets a CollidableProxy instance by index.

Parameters
IndexThe index of the CollidableProxy to be retrieved.
Returns
Returns a pointer to the CollidableProxy at the specified index.

Definition at line 844 of file physicsmanager.cpp.

Threading::DefaultWorkUnit * Mezzanine::Physics::PhysicsManager::GetSimulationWork ( )

Gets a pointer to the work unit that steps the simulation.

Returns
Returns a pointer to the DefaultWorkUnit that steps the simulation.

Definition at line 1207 of file physicsmanager.cpp.

Vector3 Mezzanine::Physics::PhysicsManager::GetWorldGravity ( )

Gets the gravity.

Gets the currently set world gravity.

Returns
Returns the currently set world gravity.

Definition at line 779 of file physicsmanager.cpp.

Vector3 Mezzanine::Physics::PhysicsManager::GetWorldSoftGravity ( )

Gets the soft body gravity.

Gets the currently set soft body world gravity.

Returns
Returns the currently set soft body world gravity.

Definition at line 790 of file physicsmanager.cpp.

WorldTrigger * Mezzanine::Physics::PhysicsManager::GetWorldTrigger ( const String Name)

Gets a trigger by name.

Parameters
NameThe name of the trigger to find.
Returns
Returns a pointer to the named trigger, or NULL if it doesn't exist.

Definition at line 929 of file physicsmanager.cpp.

WorldTrigger * Mezzanine::Physics::PhysicsManager::GetWorldTrigger ( const Whole Index)

Gets a trigger by index.

Parameters
IndexThe index of the trigger you want.
Returns
Returns a pointer to the trigger at the specified index.

Definition at line 941 of file physicsmanager.cpp.

WorldTriggerUpdateWorkUnit * Mezzanine::Physics::PhysicsManager::GetWorldTriggerUpdateWork ( )

Gets a pointer to the work unit that updates all WorldTriggers.

Returns
Returns a pointer to the WorldTriggerUpdateWorkUnit used by this manager.

Definition at line 1212 of file physicsmanager.cpp.

void Mezzanine::Physics::PhysicsManager::Initialize ( )
virtual

Configures this manager for use prior to entering the main loop.

Exceptions
Ifthis is called while no valid world is set, this will throw an "INVALID_STATE_EXCEPTION".

Reimplemented from Mezzanine::WorldManager.

Definition at line 1132 of file physicsmanager.cpp.

void Mezzanine::Physics::PhysicsManager::Pause ( const UInt32  PL)
virtual

Sets the pause state of this manager, or has no effect depending on the value passed in.

Parameters
PLA bitfield describing the pause level being assigned to the parent world of this manager.

Implements Mezzanine::WorldManager.

Definition at line 1112 of file physicsmanager.cpp.

void Mezzanine::Physics::PhysicsManager::PauseSimulation ( bool  Pause)

Pauses the simulation, preventing the physics world from taking action.

Parameters
PauseWether or not to pause the simulation.

Definition at line 761 of file physicsmanager.cpp.

void Mezzanine::Physics::PhysicsManager::ProcessAllCollisions ( )
protectedvirtual

Checks the internal collision data and generates/updates collisions as necessary.

This function is automatically called every step.

Todo:
This is an absurd round-about way to get the data we need, and bullet will probably have to be extended to change this so it's actually good.

Definition at line 697 of file physicsmanager.cpp.

void Mezzanine::Physics::PhysicsManager::ProcessAllTriggers ( )
protectedvirtual

Calls the ConditionsAreMet() and ApplyTrigger() functions of every stored trigger.

This function is automatically called every step.

Definition at line 685 of file physicsmanager.cpp.

void Mezzanine::Physics::PhysicsManager::RemoveCollision ( Physics::Collision Col)

Removes an existing collision from the world.

Remarks
In general it's not a great idea to call on this manually, but there are some situations where you would. Mostly this function exists to facilitate removal of objects from the world before the simulation ends. In such cases you have to clean up traces of the collision.
Parameters
ColThe collision to be removed.

Definition at line 985 of file physicsmanager.cpp.

void Mezzanine::Physics::PhysicsManager::RemoveCollisionsContainingProxy ( CollidableProxy Proxy)

Removes all stored collisions that involve the specified CollidableProxy.

Parameters
ProxyThe Proxy which will have all of it's collisions removed.

Definition at line 999 of file physicsmanager.cpp.

void Mezzanine::Physics::PhysicsManager::RemoveConstraint ( Physics::Constraint Con)

Removes a constraint from the world.

Removes a constraint from the world so that it will have no effect.

Parameters
ConThe constraint to be removed.

Definition at line 898 of file physicsmanager.cpp.

void Mezzanine::Physics::PhysicsManager::RemoveWorldTrigger ( WorldTrigger Trig)

Removes a trigger from the world.

Removes a trigger from the world so that it will have no effect.

Parameters
TrigThe trigger to be removed.

Definition at line 951 of file physicsmanager.cpp.

void Mezzanine::Physics::PhysicsManager::ResetPhysicsWorld ( ManagerConstructionInfo Info = 0)

Resets all the internal physics structures in this manager.

Warning
This should only be called while the world is emtpy and objects have be unloaded from it.
Parameters
InfoIf you want to change the configuration of the world when restarting, you can optionally provide a new set of parameters to build the world with.

Definition at line 1069 of file physicsmanager.cpp.

void Mezzanine::Physics::PhysicsManager::SetDebugRenderingMode ( const Integer  DebugRenderingMode)

Enables and Disables Physics Debug Drawing.

Enables and Disables Physics Debug Drawing using default wireframes. This will force renderings that match the physics subsytem pixel for pixel.

Parameters
DebugRenderingMode1 to turn it on, 0 to turn it off. There may be other options in the future, to enable fine tuned control

Definition at line 1053 of file physicsmanager.cpp.

void Mezzanine::Physics::PhysicsManager::SetSimulationSubstepModifier ( const Whole Modifier)

Sets the modifier to be used when stepping the physics simulation.

Remarks
For the most part, the simulation tick is determined by your target framerate set on Mezzanine::World. However there are some occasions when you will want to have it tick more often, in particular with sensative simulation setups involving many constraints, or small objects, or fast moving objects, or any combination of those. In order to make your simulation more stable you have to tick in smaller intervals, making it less likely for the engine to miss something or become unstable. When you pass in a modifier it'll ensure it ticks faster by that amount. For example, if you pass in 2 to this as the modifier, the physics simulation will take 2 smaller steps (the time being based on the target framerate) instead of one big one during the course of one frame.
Parameters
ModifierThe amount of substeps per frame to perform.

Definition at line 1107 of file physicsmanager.cpp.

void Mezzanine::Physics::PhysicsManager::SetWorldGravity ( const Vector3 pgrav)

Sets the gravity.

Sets the strength and direction of gravity within the world.

Parameters
pgravVector3 representing the strength and direction of gravity.

Definition at line 774 of file physicsmanager.cpp.

void Mezzanine::Physics::PhysicsManager::SetWorldSoftGravity ( const Vector3 sgrav)

Sets the gravity for soft bodies.

Gravity for soft bodies is stored separately from rigid bodies. So if you plan to use soft bodies in your game/simulation you need to call this function otherwise they won't fall.

Parameters
sgravVector3 representing the strength and direction of gravity.

Definition at line 785 of file physicsmanager.cpp.

bool Mezzanine::Physics::PhysicsManager::SimulationIsPaused ( )

Gets Whether or not the simulation is currently paused.

Returns
Returns whether or not the simulation is paused.

Definition at line 766 of file physicsmanager.cpp.

Member Data Documentation

DebugDrawWorkUnit* Mezzanine::Physics::PhysicsManager::DebugDrawWork
protected

The work unit that updates the debug drawer with the latest physics rendering.

Definition at line 306 of file physicsmanager.h.

Threading::DefaultWorkUnit* Mezzanine::Physics::PhysicsManager::SimulationWork
protected

The work unit that does the stepping of the simulation.

Definition at line 300 of file physicsmanager.h.

Threading::DefaultThreadSpecificStorage::Type* Mezzanine::Physics::PhysicsManager::ThreadResources
protected

Can be used for thread safe logging and other thread specific resources.

Definition at line 309 of file physicsmanager.h.

WorldTriggerUpdateWorkUnit* Mezzanine::Physics::PhysicsManager::WorldTriggerUpdateWork
protected

The work unit that processes all world triggers.

Definition at line 303 of file physicsmanager.h.


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