40 #ifndef _physicsphysicsmanager_h
41 #define _physicsphysicsmanager_h
45 class btDefaultCollisionConfiguration;
46 class btCollisionDispatcher;
47 class btSequentialImpulseConstraintSolver;
48 class btSoftRigidDynamicsWorld;
49 class btDiscreteDynamicsWorld;
50 class btDynamicsWorld;
51 class btCollisionShape;
52 class btSoftBodyRigidBodyCollisionConfiguration;
53 class btGhostPairCallback;
54 class btBroadphaseInterface;
55 class btCollisionConfiguration;
56 class btThreadSupportInterface;
58 typedef float btScalar;
62 #include "uidgenerator.h"
63 #include "worldmanager.h"
64 #include "worldmanagerfactory.h"
65 #include "singleton.h"
67 #include "Physics/collidablepair.h"
68 #include "Physics/constraint.h"
69 #include "Physics/managerconstructioninfo.h"
81 class InternalDebugDrawer;
86 class CollisionDispatcher;
87 class ParallelCollisionDispatcher;
90 class CollidableProxy;
97 class ConeTwistConstraint;
99 class Generic6DofConstraint;
100 class Generic6DofSpringConstraint;
101 class HingeConstraint;
102 class Hinge2Constraint;
103 class Point2PointConstraint;
104 class SliderConstraint;
105 class UniversalConstraint;
172 virtual void UseThreads(
const Whole& AmountToUse);
175 virtual Whole UsingThreadCount();
387 virtual void Destroy();
391 virtual void ProcessAllTriggers();
394 virtual void ProcessAllCollisions();
400 static void InternalTickCallback(btDynamicsWorld* world, btScalar timeStep);
420 void PauseSimulation(
Boole Pause);
423 Boole SimulationIsPaused();
427 Real GetTimeMultiplier()
const;
430 void SetTimeMultiplier(
const Real &value);
438 void SetWorldGravity(
const Vector3& pgrav);
447 void SetWorldSoftGravity(
const Vector3& sgrav);
512 UInt32 GetNumProxies()
const;
517 void DestroyAllProxies();
522 ProxyIterator BeginCollidableProxy();
525 ProxyIterator EndCollidableProxy();
528 ConstProxyIterator BeginCollidableProxy()
const;
531 ConstProxyIterator EndCollidableProxy()
const;
719 Whole GetNumConstraints();
724 void DestroyAllConstraints();
743 Whole GetNumWorldTriggers();
749 void DestroyAllWorldTriggers();
765 Whole GetNumCollisions();
776 void DestroyAllCollisions();
780 CollisionMapIterator BeginCollision();
783 CollisionMapIterator EndCollision();
784 #if !(defined(SWIG) && defined(MEZZLUA51)) // Stop Swig from making lua bindings but allow other languages
787 ConstCollisionMapIterator BeginCollision()
const;
790 ConstCollisionMapIterator EndCollision()
const;
800 void SetDebugRenderingMode(
const Integer DebugRenderingMode);
804 Integer GetDebugRenderingMode()
const;
816 void ClearPhysicsMetaData();
826 void SetSimulationSubstepModifier(
const Whole& Modifier);
829 virtual void Pause(
const UInt32 PL);
832 void MainLoopInitialize();
834 virtual void Initialize();
836 virtual void Deinitialize();
858 virtual String GetImplementationTypeName()
const;
863 #if !(defined(SWIG) && defined(MEZZLUA51)) // Stop Swig from making lua bindings but allow other languages
866 btSoftRigidDynamicsWorld* _GetPhysicsWorldPointer();
869 const btSoftRigidDynamicsWorld* _GetPhysicsWorldPointer()
const;
886 String GetManagerImplName()
const;
This is the base class for all collision shapes.
UIDGenerator ProxyIDGen
Generator responsible for creating unique IDs for CollidableProxy instances.
DebugDrawWorkUnit * DebugDrawWork
The work unit that updates the debug drawer with the latest physics rendering.
This is used to draw wireframse for the Physics subsystem.
Threading::DefaultWorkUnit * SimulationWork
The work unit that does the stepping of the simulation.
CollisionContainer::iterator CollisionIterator
Iterator type for Collision instances stored by this class.
WorldTriggerContainer::iterator WorldTriggerIterator
Iterator type for WorldTrigger instances stored by this class.
bool Boole
Generally acts a single bit, true or false.
Default implementation of WorkUnit. This represents on piece of work through time.
PhysicsManager * TargetManager
A pointer to the manager this work unit is processing.
Real TimeMultiplier
A Multiplier that adjusts how fast physics runs relative to clock time.
ManagerType
A listing of Manager Types.
This is the proxy object for ghost objects with no contact response.
std::vector< WorldTrigger * > WorldTriggerContainer
Basic container type for WorldTrigger storage by this class.
All the definitions for datatypes as well as some basic conversion functions are defined here...
int Integer
A datatype used to represent any integer close to.
This is a constraint for permitting movement on only a singular linear or angular axis...
std::pair< CollidablePair, Collision * > CollisionSortPair
A std::pair to assist with collision sorting operations.
UIDGenerator ConstraintIDGen
Generator responsible for creating unique IDs for Constraint instances.
std::map< CollidablePair, Collision * > CollisionMap
Container type for storing Collision instances based on the pair of proxies that are colliding...
WorldTriggerContainer Triggers
A container storing all of the worldtriggers owned by this manager.
ConstraintContainer Constraints
A container storing all of the constraints owned by this manager.
Create simple but specific limits on any axis of movement or rotation.
This is the base class for all constraints supported.
ConstraintContainer::iterator ConstraintIterator
Iterator type for Constraint instances stored by this class.
This is a Mezzanine::Threading::iWorkUnit for the single threaded processing of physics simulations...
This is a Mezzanine::Threading::iWorkUnit for the updating of WorldTriggers.
This is a constraint for sharing the rotation of one object along an angular axis with another...
ProxyContainer Proxies
A container storing all of the proxies owned by this manager.
Whole ThreadCount
The number of threads the internal thread providers should allocate.
btThreadSupportInterface * BulletDispatcherThreads
A pointer to the thread provider for the internal dispatcher (narrowphase).
Whole SubstepModifier
A modifier that will determine how many substeps each frame the physics simulation should perform...
A kind of workunit given exclusive runtime so it can consume time on multiple threads.
debug::InternalDebugDrawer * BulletDrawer
A pointer to the debug drawer for rendering the physics world.
PhysicsManager * TargetManager
A pointer to the manager this work unit is processing.
float Real
A Datatype used to represent a real floating point number.
This is a constraint that will limit the movement allowed from one body to within a cone area around ...
Tries to make a point relative to each of two actors match in 3d space, without regard to rotation...
A thread specific collection of double-buffered and algorithm specific resources. ...
PhysicsManager * TargetManager
A pointer to the manager this work unit is processing.
Boole SimulationPaused
Whether or not the physics simulation is to step each frame.
btCollisionConfiguration * BulletCollisionConfiguration
A pointer to the internal collision configuration that enables certain types of objects to collide...
static const ManagerBase::ManagerType InterfaceType
A ManagerType enum value used to describe the type of interface/functionality this manager provides...
This class will generate keep track of a pool of unique 32-bit ID's that can be used for distinct obj...
A light-weight handle for manipulating nodes in DOM tree.
This is the proxy object for soft/compressable bodies.
This is an abstract class for creating in-game triggers.
ProxyType
Used by all World proxies to describe what their derived types are.
uint32_t UInt32
An 32-bit unsigned integer.
WorldTriggerUpdateWorkUnit * WorldTriggerUpdateWork
The work unit that processes all world triggers.
This is an event class used to track collsions in the physics world.
ConstraintContainer::const_iterator ConstConstraintIterator
Const Iterator type for Constraint instances stored by this class.
Used to provide better reporting of collisions.
std::vector< Collision * > CollisionContainer
Basic container type for Collision storage by this class.
This is a convience class that will configure a 6DoF spring constraint with 2 angular and 1 linear (w...
A factory responsible for the creation and destruction of the default physicsmanager.
This is a Mezzanine::Threading::iWorkUnit for the multi-threaded processing of physics simulations...
CollisionMap::iterator CollisionMapIterator
Iterator type for sorted Collision instances.
WorldTriggerContainer::const_iterator ConstWorldTriggerIterator
Const Iterator type for WorldTrigger instances stored by this class.
This is a helper class for storing pairs of collidable proxies in associative containers.
std::list< NameValuePair > NameValuePairList
This is a datatype mostly used for describing settings or parameters that can't be declared in advanc...
This is a proxy from which rigid body proxys are handled.
This is a Mezzanine::Threading::iWorkUnit for the updating of the physics debug drawer.
This is the base class for all managers that belong to a single world instance.
This is a proxy from which physics objects that can collide with each other are handled.
CollisionContainer::const_iterator ConstCollisionIterator
Const Iterator type for Collision instances stored by this class.
std::vector< Constraint * > ConstraintContainer
Basic container type for Constraint storage by this class.
Used to provide better reporting of collisions in a multithreaded environment.
This is simply a place for storing all the Physics Related functions.
Contains an interface for a kind of WorkUnit that consumes time on multiple thread.
btBroadphaseInterface * BulletBroadphase
A pointer to the physics broadphase of the simulation.
This is a constraint that duplicate the angular motion of one object to another, adjusted by the prov...
btSoftRigidDynamicsWorld * BulletDynamicsWorld
A pointer to the internal physics world.
This is a constraint to be used to restrict the movement between two objects to angular rotation on a...
This is used to represent a point in space, or a vector through space.
ProxyContainer::iterator ProxyIterator
Iterator type for CollidableProxy instances stored by this class.
Real StepSize
The amount of time (in seconds) a single simulation step should advance.
The bulk of the engine components go in this namspace.
unsigned long Whole
Whole is an unsigned integer, it will be at least 32bits in size.
This class represents a world for objects to interact within.
std::vector< CollidableProxy * > ProxyContainer
Basic container type for CollidableProxy storage by this class.
Integer DebugRenderMode
The current rendering mode for the debug drawer.
btGhostPairCallback * GhostCallback
A pointer to the callback that enables ghost objects internally.
btSequentialImpulseConstraintSolver * BulletSolver
A pointer to the internal constraint solver.
This is a base class for factories that construct managers used by the World class.
static PhysicsManager * CallBackWorld
The World that will be used for the InternalTickCallback.
btThreadSupportInterface * BulletSolverThreads
A pointer to the thread provider for the internal constraint solver.
Creates a constraint as configurable as the 6Dof constraint, but has added support for spring motion...
btCollisionDispatcher * BulletDispatcher
A pointer to the internal dispatcher (narrowphase).
CollisionMap Collisions
A container tracking all of the existing collisions in the physics world.
PhysicsManager * TargetManager
A pointer to the manager this work unit is processing.
std::string String
A datatype used to a series of characters.
ManagerConstructionInfo WorldConstructionInfo
A copy of the information used to initialize this manager.
This is a helper class storing information needed for the construction of a PhysicsManager.
static const String ImplementationName
A String containing the name of this manager implementation.
ProxyContainer::const_iterator ConstProxyIterator
Const Iterator type for CollidableProxy instances stored by this class.
CollisionMap::const_iterator ConstCollisionMapIterator
Const Iterator type for sorted Collision instances.
This file has the definition of the workunit.