Spinning Topp Logo BlackTopp Studios
inc
Public Types | Public Member Functions | Static Public Attributes | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static 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::vector< 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::map< CollidablePair, Collision * > CollisionMap
 Container type for storing Collision instances based on the pair of proxies that are colliding.
 
typedef CollisionMap::iterator CollisionMapIterator
 Iterator type for sorted Collision instances.
 
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 CollisionMap::const_iterator ConstCollisionMapIterator
 Const Iterator type for sorted Collision instances.
 
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 Types inherited from Mezzanine::ManagerBase
enum  ManagerType {
  MT_Undefined = 0, MT_AudioManager = 1, MT_AnimationManager = 2, MT_CollisionShapeManager = 3,
  MT_CompositorManager = 4, MT_GraphicsManager = 5, MT_EventManager = 6, MT_InputManager = 7,
  MT_LogManager = 8, MT_MaterialManager = 9, MT_MeshManager = 10, MT_NetworkManager = 11,
  MT_ResourceManager = 12, MT_ScriptingManager = 13, MT_TextureManager = 14, MT_UIManager = 15,
  MT_ActorManager = 101, MT_AreaEffectManager = 102, MT_DebrisManager = 103, MT_PagingManager = 104,
  MT_PhysicsManager = 105, MT_SceneManager = 106, MT_SoundScapeManager = 107, MT_TerrainManager = 108,
  MT_VehicleManager = 109, MT_UserCreated = 512
}
 A listing of Manager Types. More...
 

Public Member Functions

 PhysicsManager (World *Creator)
 Default settings constructor. More...
 
 PhysicsManager (World *Creator, const ManagerConstructionInfo &Info)
 More explicit constructor. More...
 
 PhysicsManager (World *Creator, const XML::Node &XMLNode)
 XML constructor. More...
 
virtual ~PhysicsManager ()
 Class destructor.
 
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 AddWorldTrigger (WorldTrigger *Trig)
 Adds a trigger to the world. More...
 
ProxyIterator BeginCollidableProxy ()
 Gets an iterator to the first Collidable Proxy in this manager. More...
 
ConstProxyIterator BeginCollidableProxy () const
 Gets a const iterator to the first Collidable Proxy in this manager. More...
 
CollisionMapIterator BeginCollision ()
 Get an CollisionIterator to the first Collision. More...
 
ConstCollisionMapIterator 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...
 
ConeTwistConstraintCreateConeTwistConstraint (RigidProxy *ProxyA, RigidProxy *ProxyB, const Transform &TransA, const Transform &TransB)
 Creates a new ConeTwistConstraint. More...
 
ConeTwistConstraintCreateConeTwistConstraint (RigidProxy *ProxyA, const Transform &TransA)
 Creates a new ConeTwistConstraint. More...
 
ConeTwistConstraintCreateConeTwistConstraint (const XML::Node &SelfRoot)
 Creates a new ConeTwistConstraint. More...
 
GearConstraintCreateGearConstraint (RigidProxy *ProxyA, RigidProxy *ProxyB, const Vector3 &AxisA, const Vector3 &AxisB)
 Creates a new GearConstraint. More...
 
GearConstraintCreateGearConstraint (RigidProxy *ProxyA, RigidProxy *ProxyB, const Vector3 &AxisA, const Vector3 &AxisB, const Real Ratio)
 Creates a new GearConstraint. More...
 
GearConstraintCreateGearConstraint (const XML::Node &SelfRoot)
 Creates a new GearConstraint. More...
 
Generic6DofConstraintCreateGeneric6DofConstraint (RigidProxy *ProxyA, RigidProxy *ProxyB, const Transform &TransA, const Transform &TransB)
 Creates a new Generic6DofConstraint. More...
 
Generic6DofConstraintCreateGeneric6DofConstraint (RigidProxy *ProxyB, const Transform &TransB)
 Creates a new Generic6DofConstraint. More...
 
Generic6DofConstraintCreateGeneric6DofConstraint (const XML::Node &SelfRoot)
 Creates a new Generic6DofConstraint. More...
 
Generic6DofSpringConstraintCreateGeneric6DofSpringConstraint (RigidProxy *ProxyA, RigidProxy *ProxyB, const Transform &TransA, const Transform &TransB)
 Creates a new Generic6DofSpringConstraint. More...
 
Generic6DofSpringConstraintCreateGeneric6DofSpringConstraint (const XML::Node &SelfRoot)
 Creates a new Generic6DofSpringConstraint. More...
 
GhostProxyCreateGhostProxy ()
 Creates a new GhostProxy. More...
 
GhostProxyCreateGhostProxy (CollisionShape *Shape, const Boole AddToWorld)
 Creates a new GhostProxy. More...
 
GhostProxyCreateGhostProxy (const XML::Node &SelfRoot)
 Creates a new GhostProxy. More...
 
Hinge2ConstraintCreateHinge2Constraint (RigidProxy *ProxyA, RigidProxy *ProxyB, const Vector3 &Anchor, const Vector3 &Axis1, const Vector3 &Axis2)
 Creates a new Hinge2Constraint. More...
 
Hinge2ConstraintCreateHinge2Constraint (RigidProxy *ProxyA, RigidProxy *ProxyB, const Transform &TransA, const Transform &TransB)
 Creates a new Hinge2Constraint. More...
 
Hinge2ConstraintCreateHinge2Constraint (const XML::Node &SelfRoot)
 Creates a new Hinge2Constraint. More...
 
HingeConstraintCreateHingeConstraint (RigidProxy *ProxyA, RigidProxy *ProxyB, const Vector3 &PivotInA, const Vector3 &PivotInB, const Vector3 &AxisInA, const Vector3 &AxisInB)
 Creates a new HingeConstraint. More...
 
HingeConstraintCreateHingeConstraint (RigidProxy *ProxyA, RigidProxy *ProxyB, const Transform &TransA, const Transform &TransB)
 Creates a new HingeConstraint. More...
 
HingeConstraintCreateHingeConstraint (RigidProxy *ProxyA, const Vector3 &PivotInA, const Vector3 &AxisInA)
 Creates a new HingeConstraint. More...
 
HingeConstraintCreateHingeConstraint (RigidProxy *ProxyA, const Transform &TransA)
 Creates a new HingeConstraint. More...
 
HingeConstraintCreateHingeConstraint (const XML::Node &SelfRoot)
 Creates a new HingeConstraint. More...
 
Point2PointConstraintCreatePoint2PointConstraint (RigidProxy *ProxyA, RigidProxy *ProxyB, const Vector3 &PivotA, const Vector3 &PivotB)
 Creates a new Point2PointConstraint. More...
 
Point2PointConstraintCreatePoint2PointConstraint (RigidProxy *ProxyA, const Vector3 &PivotA)
 Creates a new Point2PointConstraint. More...
 
Point2PointConstraintCreatePoint2PointConstraint (const XML::Node &SelfRoot)
 Creates a new Point2PointConstraint. More...
 
RigidProxyCreateRigidProxy (const Real Mass)
 Creates a new RigidProxy. More...
 
RigidProxyCreateRigidProxy (const Real Mass, CollisionShape *Shape, const Boole AddToWorld)
 Creates a new RigidProxy. More...
 
RigidProxyCreateRigidProxy (const XML::Node &SelfRoot)
 Creates a new RigidProxy. More...
 
SliderConstraintCreateSliderConstraint (RigidProxy *ProxyA, RigidProxy *ProxyB, const Transform &TransA, const Transform &TransB)
 Creates a new SliderConstraint. More...
 
SliderConstraintCreateSliderConstraint (RigidProxy *ProxyA, const Transform &TransA)
 Creates a new SliderConstraint. More...
 
SliderConstraintCreateSliderConstraint (const XML::Node &SelfRoot)
 Creates a new SliderConstraint. More...
 
SoftProxyCreateSoftProxy (const Real Mass)
 Creates a new SoftProxy. More...
 
SoftProxyCreateSoftProxy (const XML::Node &SelfRoot)
 Creates a new SoftProxy. More...
 
UniversalConstraintCreateUniversalConstraint (RigidProxy *ProxyA, RigidProxy *ProxyB, const Vector3 &Anchor, const Vector3 &Axis1, const Vector3 &Axis2)
 Creates a new UniversalConstraint. More...
 
UniversalConstraintCreateUniversalConstraint (RigidProxy *ProxyA, RigidProxy *ProxyB, const Transform &TransA, const Transform &TransB)
 Creates a new UniversalConstraint. More...
 
UniversalConstraintCreateUniversalConstraint (const XML::Node &SelfRoot)
 Creates a new UniversalConstraint. 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.
 
void DestroyAllProxies ()
 Deletes all stored CollidableProxy instances.
 
void DestroyAllWorldTriggers ()
 Destroys all triggers currently in the manager.
 
void DestroyConstraint (Constraint *Con)
 Removes a constraint from the world and destroys it. More...
 
void DestroyProxy (CollidableProxy *ToBeDestroyed)
 Deletes a CollidableProxy. More...
 
void DoPerFrameWork (Threading::DefaultThreadSpecificStorage::Type &CurrentThreadStorage)
 The work that needs to be done each frame. More...
 
ProxyIterator EndCollidableProxy ()
 Gets an iterator to one passed the last Collidable Proxy in this manager. More...
 
ConstProxyIterator EndCollidableProxy () const
 Gets a const iterator to one passed the last Collidable Proxy in this manager. More...
 
CollisionMapIterator EndCollision ()
 Get a CollisionIterator to one past the last Collision. More...
 
ConstCollisionMapIterator EndCollision () const
 Get a ConstCollisionIterator to one past the last Collision. More...
 
Physics::CollisionGetCollision (CollidableProxy *A, CollidableProxy *B)
 Gets a Collision by collidable pair. More...
 
Physics::CollisionGetCollision (CollidablePair *Pair)
 Gets a Collision by collidable pair. More...
 
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 ManagerBase::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...
 
CollidableProxyGetProxy (const Mezzanine::ProxyType Type, UInt32 Which) const
 Gets the n-th proxy of the specified type. More...
 
CollidableProxyGetProxyByID (const UInt32 ID) const
 Gets the CollidableProxy via its ID. More...
 
Threading::DefaultWorkUnitGetSimulationWork ()
 Gets a pointer to the work unit that steps the simulation. More...
 
Real GetTimeMultiplier () const
 How much faster or slower that reality is the physic ssystem. 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 (Boole 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 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 SetTimeMultiplier (const Real &value)
 Change how fast the physicsworks relatve to well time. More...
 
void SetWorldGravity (const Vector3 &pgrav)
 Sets the gravity. More...
 
void SetWorldSoftGravity (const Vector3 &sgrav)
 Sets the gravity for soft bodies. More...
 
Boole SimulationIsPaused ()
 Gets Whether or not the simulation is currently paused. More...
 
- Public Member Functions inherited from Mezzanine::WorldManager
 WorldManager (World *Creator)
 Class constructor. More...
 
virtual ~WorldManager ()
 Class destructor.
 
virtual WorldGetWorld () const
 Gets the world this manager belongs to. More...
 
virtual Boole 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...
 
Boole IsInitialized () const
 Gets whether or not this manager has been initialized. More...
 

Static Public Attributes

static const String ImplementationName = "DefaultPhysicsManager"
 A String containing the name of this manager implementation.
 
static const ManagerBase::ManagerType InterfaceType = ManagerBase::MT_PhysicsManager
 A ManagerType enum value used to describe the type of interface/functionality this manager provides.
 

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
 A pointer to the physics broadphase of the simulation. More...
 
btCollisionConfiguration * BulletCollisionConfiguration
 A pointer to the internal collision configuration that enables certain types of objects to collide. More...
 
btCollisionDispatcher * BulletDispatcher
 A pointer to the internal dispatcher (narrowphase). More...
 
btThreadSupportInterface * BulletDispatcherThreads
 A pointer to the thread provider for the internal dispatcher (narrowphase). More...
 
debug::InternalDebugDrawerBulletDrawer
 A pointer to the debug drawer for rendering the physics world. More...
 
btSoftRigidDynamicsWorld * BulletDynamicsWorld
 A pointer to the internal physics world. More...
 
btSequentialImpulseConstraintSolver * BulletSolver
 A pointer to the internal constraint solver. More...
 
btThreadSupportInterface * BulletSolverThreads
 A pointer to the thread provider for the internal constraint solver. More...
 
CollisionMap Collisions
 A container tracking all of the existing collisions in the physics world. More...
 
UIDGenerator ConstraintIDGen
 Generator responsible for creating unique IDs for Constraint instances. More...
 
ConstraintContainer Constraints
 A container storing all of the constraints owned by this manager. More...
 
DebugDrawWorkUnitDebugDrawWork
 The work unit that updates the debug drawer with the latest physics rendering. More...
 
Integer DebugRenderMode
 The current rendering mode for the debug drawer. More...
 
btGhostPairCallback * GhostCallback
 A pointer to the callback that enables ghost objects internally. More...
 
ProxyContainer Proxies
 A container storing all of the proxies owned by this manager. More...
 
UIDGenerator ProxyIDGen
 Generator responsible for creating unique IDs for CollidableProxy instances. More...
 
Boole SimulationPaused
 Whether or not the physics simulation is to step each frame. More...
 
Threading::DefaultWorkUnitSimulationWork
 The work unit that does the stepping of the simulation. More...
 
Real StepSize
 The amount of time (in seconds) a single simulation step should advance. More...
 
Whole SubstepModifier
 A modifier that will determine how many substeps each frame the physics simulation should perform. More...
 
Whole ThreadCount
 The number of threads the internal thread providers should allocate. More...
 
Real TimeMultiplier
 A Multiplier that adjusts how fast physics runs relative to clock time. More...
 
WorldTriggerContainer Triggers
 A container storing all of the worldtriggers owned by this manager. More...
 
ManagerConstructionInfo WorldConstructionInfo
 A copy of the information used to initialize this manager. More...
 
WorldTriggerUpdateWorkUnitWorldTriggerUpdateWork
 The work unit that processes all world triggers. More...
 
- Protected Attributes inherited from Mezzanine::WorldManager
Boole 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
Boole Initialized
 Simple Boole indicating whether or not this manager has been initialized. More...
 
EntresolTheEntresol
 The actual pointer to the Entresol core class. More...
 

Static Protected Attributes

static PhysicsManagerCallBackWorld
 The World that will be used for the InternalTickCallback. 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 253 of file physicsmanager.h.

Constructor & Destructor Documentation

Mezzanine::Physics::PhysicsManager::PhysicsManager ( World Creator)

Default settings constructor.

Parameters
CreatorThe parent world that is creating the manager.

Definition at line 369 of file physicsmanager.cpp.

Mezzanine::Physics::PhysicsManager::PhysicsManager ( World Creator,
const ManagerConstructionInfo Info 
)

More explicit constructor.

Parameters
CreatorThe parent world that is creating the manager.
InfoThe construction info class with all the settings you wish the world to have.

Definition at line 397 of file physicsmanager.cpp.

Mezzanine::Physics::PhysicsManager::PhysicsManager ( World Creator,
const XML::Node XMLNode 
)

XML constructor.

Parameters
XMLNodeThe node of the xml document to construct from.

Definition at line 423 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 1503 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 1506 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 1189 of file physicsmanager.cpp.

PhysicsManager::ProxyIterator Mezzanine::Physics::PhysicsManager::BeginCollidableProxy ( )

Gets an iterator to the first Collidable Proxy in this manager.

Returns
Returns an iterator to the first Collidable Proxy being stored by this manager.

Definition at line 932 of file physicsmanager.cpp.

PhysicsManager::ConstProxyIterator Mezzanine::Physics::PhysicsManager::BeginCollidableProxy ( ) const

Gets a const iterator to the first Collidable Proxy in this manager.

Returns
Returns a const iterator to the first Collidable Proxy being stored by this manager.

Definition at line 938 of file physicsmanager.cpp.

PhysicsManager::CollisionMapIterator Mezzanine::Physics::PhysicsManager::BeginCollision ( )

Get an CollisionIterator to the first Collision.

Returns
An CollisionIterator to the first Collision.

Definition at line 1291 of file physicsmanager.cpp.

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

Get a ConstCollisionIterator to the first Collision.

Returns
A ConstCollisionIterator to the first Collision.

Definition at line 1297 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 1336 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 517 of file physicsmanager.cpp.

ConeTwistConstraint * Mezzanine::Physics::PhysicsManager::CreateConeTwistConstraint ( RigidProxy ProxyA,
RigidProxy ProxyB,
const Transform TransA,
const Transform TransB 
)

Creates a new ConeTwistConstraint.

Parameters
ProxyAThe first proxy to apply this constraint to.
ProxyBThe second proxy to apply this constraint to.
TransAThe transform in ProxyA's local space to attach this constraint to.
TransBThe transform in ProxyB's local space to attach this constraint to.
Returns
Returns a pointer to the created constraint.

Definition at line 947 of file physicsmanager.cpp.

ConeTwistConstraint * Mezzanine::Physics::PhysicsManager::CreateConeTwistConstraint ( RigidProxy ProxyA,
const Transform TransA 
)

Creates a new ConeTwistConstraint.

Parameters
ProxyAThe first proxy to apply this constraint to.
TransAThe transform in ProxyA's local space to attach this constraint to.
Returns
Returns a pointer to the created constraint.

Definition at line 954 of file physicsmanager.cpp.

ConeTwistConstraint * Mezzanine::Physics::PhysicsManager::CreateConeTwistConstraint ( const XML::Node SelfRoot)

Creates a new ConeTwistConstraint.

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

Definition at line 961 of file physicsmanager.cpp.

GearConstraint * Mezzanine::Physics::PhysicsManager::CreateGearConstraint ( RigidProxy ProxyA,
RigidProxy ProxyB,
const Vector3 AxisA,
const Vector3 AxisB 
)

Creates a new GearConstraint.

Parameters
ProxyAThe first proxy to apply this constraint to.
ProxyBThe second proxy to apply this constraint to.
PivotAThe axis in ProxyA's local space to apply the constraint to.
PivotBThe axis in ProxyB's local space to apply the constraint to.
Returns
Returns a pointer to the created constraint.

Definition at line 969 of file physicsmanager.cpp.

GearConstraint * Mezzanine::Physics::PhysicsManager::CreateGearConstraint ( RigidProxy ProxyA,
RigidProxy ProxyB,
const Vector3 AxisA,
const Vector3 AxisB,
const Real  Ratio 
)

Creates a new GearConstraint.

Parameters
ProxyAThe first proxy to apply this constraint to.
ProxyBThe second proxy to apply this constraint to.
PivotAThe axis in ProxyA's local space to apply the constraint to.
PivotBThe axis in ProxyB's local space to apply the constraint to.
RatioThe amount the rotation from ProxyA that shall be used to be applied to ProxyB.
Returns
Returns a pointer to the created constraint.

Definition at line 976 of file physicsmanager.cpp.

GearConstraint * Mezzanine::Physics::PhysicsManager::CreateGearConstraint ( const XML::Node SelfRoot)

Creates a new GearConstraint.

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

Definition at line 983 of file physicsmanager.cpp.

Generic6DofConstraint * Mezzanine::Physics::PhysicsManager::CreateGeneric6DofConstraint ( RigidProxy ProxyA,
RigidProxy ProxyB,
const Transform TransA,
const Transform TransB 
)

Creates a new Generic6DofConstraint.

Parameters
ProxyAThe First proxy to be bound.
ProxyBThe Second proxy to be bound.
TransAThe offset and rotation from ProxyAs center of gravity to get to match an offset from ProxyB.
TransBThe offset and rotation from ProxyBs center of gravity.
Returns
Returns a pointer to the created constraint.

Definition at line 991 of file physicsmanager.cpp.

Generic6DofConstraint * Mezzanine::Physics::PhysicsManager::CreateGeneric6DofConstraint ( RigidProxy ProxyB,
const Transform TransB 
)

Creates a new Generic6DofConstraint.

Parameters
ProxyBThe proxy to be bound to the world.
TransBThe offset and rotation for the ProxyB pivot/hinge/joint.
Returns
Returns a pointer to the created constraint.

Definition at line 998 of file physicsmanager.cpp.

Generic6DofConstraint * Mezzanine::Physics::PhysicsManager::CreateGeneric6DofConstraint ( const XML::Node SelfRoot)

Creates a new Generic6DofConstraint.

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

Definition at line 1005 of file physicsmanager.cpp.

Generic6DofSpringConstraint * Mezzanine::Physics::PhysicsManager::CreateGeneric6DofSpringConstraint ( RigidProxy ProxyA,
RigidProxy ProxyB,
const Transform TransA,
const Transform TransB 
)

Creates a new Generic6DofSpringConstraint.

Parameters
ProxyAThe First proxy to be bound.
ProxyBThe Second proxy to be bound.
TransAThe offset and rotation from ProxyAs center of gravity to get to match an offset from ProxyB.
TransBThe offset and rotation from ProxyBs center of gravity.
Returns
Returns a pointer to the created constraint.

Definition at line 1013 of file physicsmanager.cpp.

Generic6DofSpringConstraint * Mezzanine::Physics::PhysicsManager::CreateGeneric6DofSpringConstraint ( const XML::Node SelfRoot)

Creates a new Generic6DofSpringConstraint.

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

Definition at line 1020 of file physicsmanager.cpp.

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

Creates a new GhostProxy.

Returns
Returns a pointer to the created proxy.

Definition at line 802 of file physicsmanager.cpp.

GhostProxy * Mezzanine::Physics::PhysicsManager::CreateGhostProxy ( CollisionShape Shape,
const Boole  AddToWorld 
)

Creates a new GhostProxy.

Parameters
ShapeA pointer to the collision shape that will be applied to the new proxy.
AddToWorldWether or not the new proxy should be added to the world after it has been created.
Returns
Returns a pointer to the created proxy.

Definition at line 809 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 819 of file physicsmanager.cpp.

Hinge2Constraint * Mezzanine::Physics::PhysicsManager::CreateHinge2Constraint ( RigidProxy ProxyA,
RigidProxy ProxyB,
const Vector3 Anchor,
const Vector3 Axis1,
const Vector3 Axis2 
)

Creates a new Hinge2Constraint.

Remarks
All axes passed in should be in world coordinates.
Parameters
ProxyAA pointer to the first proxy that will be constrained.
ProxyBA pointer to the second proxy that will be constrained.
AnchorThe point in world cocrdinates where the "axel" and "suspension" meet.
Axis1The axis on which the child object should rotate about the parent object(aka turning). Must be orthogonal to Axis2.
Axis2The axis on which the child object will rotate on it's own(aka spinning).
Returns
Returns a pointer to the created constraint.

Definition at line 1064 of file physicsmanager.cpp.

Hinge2Constraint * Mezzanine::Physics::PhysicsManager::CreateHinge2Constraint ( RigidProxy ProxyA,
RigidProxy ProxyB,
const Transform TransA,
const Transform TransB 
)

Creates a new Hinge2Constraint.

Parameters
ProxyAA pointer to the first proxy that will be constrained.
ProxyBA pointer to the second proxy that will be constrained.
TransAThe offset and rotation from ProxyAs center of gravity to get to match an offset from ProxyB.
TransBThe offset and rotation from ProxyBs center of gravity.
Returns
Returns a pointer to the created constraint.

Definition at line 1071 of file physicsmanager.cpp.

Hinge2Constraint * Mezzanine::Physics::PhysicsManager::CreateHinge2Constraint ( const XML::Node SelfRoot)

Creates a new Hinge2Constraint.

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

Definition at line 1078 of file physicsmanager.cpp.

HingeConstraint * Mezzanine::Physics::PhysicsManager::CreateHingeConstraint ( RigidProxy ProxyA,
RigidProxy ProxyB,
const Vector3 PivotInA,
const Vector3 PivotInB,
const Vector3 AxisInA,
const Vector3 AxisInB 
)

Creates a new HingeConstraint.

Parameters
ProxyAThe first proxy to apply this constraint to.
ProxyBThe second proxy to apply this constraint to.
PivotAThe location in ProxyA's local space to apply the constraint to.
PivotBThe location in ProxyB's local space to apply the constraint to.
AxisInAThe axis(for ProxyA) on which the hinge is to act. For example, a door hinge would be (0.0,1.0,0.0), aka the positive Y axis.
AxisInBThe axis(for ProxyB) on which the hinge is to act. For example, a door hinge would be (0.0,1.0,0.0), aka the positive Y axis.
Returns
Returns a pointer to the created constraint.

Definition at line 1028 of file physicsmanager.cpp.

HingeConstraint * Mezzanine::Physics::PhysicsManager::CreateHingeConstraint ( RigidProxy ProxyA,
RigidProxy ProxyB,
const Transform TransA,
const Transform TransB 
)

Creates a new HingeConstraint.

Parameters
ProxyAThe first proxy to apply this constraint to.
ProxyBThe second proxy to apply this constraint to.
TransAThe offset and rotation from ProxyAs center of gravity to get to match an offset from ProxyB.
TransBThe offset and rotation from ProxyBs center of gravity.
Returns
Returns a pointer to the created constraint.

Definition at line 1035 of file physicsmanager.cpp.

HingeConstraint * Mezzanine::Physics::PhysicsManager::CreateHingeConstraint ( RigidProxy ProxyA,
const Vector3 PivotInA,
const Vector3 AxisInA 
)

Creates a new HingeConstraint.

Parameters
ProxyAThe proxy to apply this constraint to.
PivotInAThe point in the objects(ProxyA) local space where the constraint is to be attached to world space.
AxisInAThe axis(for ProxyA) on which the hinge is to act. For example, a door hinge would be (0.0,1.0,0.0), aka the positive Y axis.
Returns
Returns a pointer to the created constraint.

Definition at line 1042 of file physicsmanager.cpp.

HingeConstraint * Mezzanine::Physics::PhysicsManager::CreateHingeConstraint ( RigidProxy ProxyA,
const Transform TransA 
)

Creates a new HingeConstraint.

Parameters
ProxyAThe first proxy to apply this constraint to.
TransBThe offset and rotation from ProxyAs center of gravity.
Returns
Returns a pointer to the created constraint.

Definition at line 1049 of file physicsmanager.cpp.

HingeConstraint * Mezzanine::Physics::PhysicsManager::CreateHingeConstraint ( const XML::Node SelfRoot)

Creates a new HingeConstraint.

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

Definition at line 1056 of file physicsmanager.cpp.

Point2PointConstraint * Mezzanine::Physics::PhysicsManager::CreatePoint2PointConstraint ( RigidProxy ProxyA,
RigidProxy ProxyB,
const Vector3 PivotA,
const Vector3 PivotB 
)

Creates a new Point2PointConstraint.

Parameters
ProxyAThe first proxy to apply this constraint to.
ProxyBThe second proxy to apply this constraint to.
PivotAThe location in ProxyA's local space to apply the constraint to.
PivotBThe location in ProxyB's local space to apply the constraint to.
Returns
Returns a pointer to the created constraint.

Definition at line 1086 of file physicsmanager.cpp.

Point2PointConstraint * Mezzanine::Physics::PhysicsManager::CreatePoint2PointConstraint ( RigidProxy ProxyA,
const Vector3 PivotA 
)

Creates a new Point2PointConstraint.

Parameters
ProxyAThe proxy to apply this constraint to.
PivotAThe position relative to ProxyA's center of gravity to "Pin" to the world.
Returns
Returns a pointer to the created constraint.

Definition at line 1093 of file physicsmanager.cpp.

Point2PointConstraint * Mezzanine::Physics::PhysicsManager::CreatePoint2PointConstraint ( const XML::Node SelfRoot)

Creates a new Point2PointConstraint.

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

Definition at line 1100 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 827 of file physicsmanager.cpp.

RigidProxy * Mezzanine::Physics::PhysicsManager::CreateRigidProxy ( const Real  Mass,
CollisionShape Shape,
const Boole  AddToWorld 
)

Creates a new RigidProxy.

Parameters
MassThe mass of the new proxy.
AddToWorldWether or not the new proxy should be added to the world after it has been created.
ShapeA pointer to the collision shape that will be applied to the new proxy.
Returns
Returns a pointer to the created proxy.

Definition at line 834 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 844 of file physicsmanager.cpp.

SliderConstraint * Mezzanine::Physics::PhysicsManager::CreateSliderConstraint ( RigidProxy ProxyA,
RigidProxy ProxyB,
const Transform TransA,
const Transform TransB 
)

Creates a new SliderConstraint.

Parameters
ProxyAThe First proxy to be bound.
ProxyBThe Second proxy to be bound.
TransAThe offset and rotation from ProxyA's center of gravity to get to match an offset from ProxyB.
TransBThe offset and rotation from ProxyB's center of gravity.
Returns
Returns a pointer to the created constraint.

Definition at line 1108 of file physicsmanager.cpp.

SliderConstraint * Mezzanine::Physics::PhysicsManager::CreateSliderConstraint ( RigidProxy ProxyA,
const Transform TransA 
)

Creates a new SliderConstraint.

Parameters
ProxyAThe First proxy to be bound.
TransAThe offset and rotation from ProxyA's center of gravity.
Returns
Returns a pointer to the created constraint.

Definition at line 1115 of file physicsmanager.cpp.

SliderConstraint * Mezzanine::Physics::PhysicsManager::CreateSliderConstraint ( const XML::Node SelfRoot)

Creates a new SliderConstraint.

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

Definition at line 1122 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 852 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 859 of file physicsmanager.cpp.

UniversalConstraint * Mezzanine::Physics::PhysicsManager::CreateUniversalConstraint ( RigidProxy ProxyA,
RigidProxy ProxyB,
const Vector3 Anchor,
const Vector3 Axis1,
const Vector3 Axis2 
)

Creates a new UniversalConstraint.

Parameters
ProxyAA pointer to the first proxy that will be constrained.
ProxyBA pointer to the second proxy that will be constrained.
AnchorThe central point around both Axis1 and Axis 2 will connect and spin.
Axis1An axis perpendicular to the axis you wish to have the ProxyA spin.
Axis2An axis perpendicular to the axis you wish to have the ProxyB spin.
Returns
Returns a pointer to the created constraint.

Definition at line 1130 of file physicsmanager.cpp.

UniversalConstraint * Mezzanine::Physics::PhysicsManager::CreateUniversalConstraint ( RigidProxy ProxyA,
RigidProxy ProxyB,
const Transform TransA,
const Transform TransB 
)

Creates a new UniversalConstraint.

Parameters
ProxyAA pointer to the first proxy that will be constrained.
ProxyBA pointer to the second proxy that will be constrained.
TransAThe offset and rotation from ProxyAs center of gravity to get to match an offset from ProxyB.
TransBThe offset and rotation from ProxyBs center of gravity.
Returns
Returns a pointer to the created constraint.

Definition at line 1137 of file physicsmanager.cpp.

UniversalConstraint * Mezzanine::Physics::PhysicsManager::CreateUniversalConstraint ( const XML::Node SelfRoot)

Creates a new UniversalConstraint.

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

Definition at line 1144 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 1427 of file physicsmanager.cpp.

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

Removes a constraint from the world and destroys it.

Parameters
ConThe constraint to be destroyed.

Definition at line 1161 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 901 of file physicsmanager.cpp.

void Mezzanine::Physics::PhysicsManager::DoPerFrameWork ( Threading::DefaultThreadSpecificStorage::Type CurrentThreadStorage)

The work that needs to be done each frame.

Parameters
CurrentThreadStorageThe context of the current frame for the work to do.

Definition at line 1461 of file physicsmanager.cpp.

PhysicsManager::ProxyIterator Mezzanine::Physics::PhysicsManager::EndCollidableProxy ( )

Gets an iterator to one passed the last Collidable Proxy in this manager.

Returns
Returns an iterator to one passed the last Collidable Proxy being stored by this manager.

Definition at line 935 of file physicsmanager.cpp.

PhysicsManager::ConstProxyIterator Mezzanine::Physics::PhysicsManager::EndCollidableProxy ( ) const

Gets a const iterator to one passed the last Collidable Proxy in this manager.

Returns
Returns a const iterator to one passed the last Collidable Proxy being stored by this manager.

Definition at line 941 of file physicsmanager.cpp.

PhysicsManager::CollisionMapIterator 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 1294 of file physicsmanager.cpp.

PhysicsManager::ConstCollisionMapIterator 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 1300 of file physicsmanager.cpp.

Physics::Collision * Mezzanine::Physics::PhysicsManager::GetCollision ( CollidableProxy A,
CollidableProxy B 
)

Gets a Collision by collidable pair.

Parameters
AThe first proxy in the collision pair.
BThe second proxy in the collision pair.
Returns
Returns a pointer to the Collision if a collision for the provided pair exists, NULL otherwise.

Definition at line 1230 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 1236 of file physicsmanager.cpp.

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 1155 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 1488 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 1314 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 1497 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 1494 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 1243 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 1158 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 898 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 1206 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 870 of file physicsmanager.cpp.

CollidableProxy * Mezzanine::Physics::PhysicsManager::GetProxy ( const Mezzanine::ProxyType  Type,
UInt32  Which 
) const

Gets the n-th proxy of the specified type.

Note
This manager only stores CollidableProxy types. As such, specifying a type of proxy that isn't derived from CollidableProxy will always return NULL.
Parameters
TypeThe type of proxy to retrieve.
WhichWhich proxy of the specified type to retrieve.
Returns
Returns a pointer to the specified proxy, or NULL if there is no n-th proxy.

Definition at line 873 of file physicsmanager.cpp.

CollidableProxy * Mezzanine::Physics::PhysicsManager::GetProxyByID ( const UInt32  ID) const

Gets the CollidableProxy via its ID.

Parameters
IDThe unique identifier belonging to the Proxy.
Returns
Returns a pointer to the CollidableProxy with the specified ID.

Definition at line 887 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 1482 of file physicsmanager.cpp.

Real Mezzanine::Physics::PhysicsManager::GetTimeMultiplier ( ) const

How much faster or slower that reality is the physic ssystem.

Returns
1 indicates normal time, less indicates slower and higher indicates faster times

Definition at line 772 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 784 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 793 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 1192 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 1203 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 1485 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 1383 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 1363 of file physicsmanager.cpp.

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

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

Parameters
PauseWether or not to pause the simulation.

Definition at line 766 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 679 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 667 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 1246 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 1260 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 1209 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 1320 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 1306 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 1360 of file physicsmanager.cpp.

void Mezzanine::Physics::PhysicsManager::SetTimeMultiplier ( const Real value)

Change how fast the physicsworks relatve to well time.

Parameters
value2.0 to double simulation, .5 to half it.

Definition at line 775 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 781 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 790 of file physicsmanager.cpp.

Boole 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 769 of file physicsmanager.cpp.

Member Data Documentation

btBroadphaseInterface* Mezzanine::Physics::PhysicsManager::BulletBroadphase
protected

A pointer to the physics broadphase of the simulation.

Definition at line 355 of file physicsmanager.h.

btCollisionConfiguration* Mezzanine::Physics::PhysicsManager::BulletCollisionConfiguration
protected

A pointer to the internal collision configuration that enables certain types of objects to collide.

Definition at line 358 of file physicsmanager.h.

btCollisionDispatcher* Mezzanine::Physics::PhysicsManager::BulletDispatcher
protected

A pointer to the internal dispatcher (narrowphase).

Definition at line 361 of file physicsmanager.h.

btThreadSupportInterface* Mezzanine::Physics::PhysicsManager::BulletDispatcherThreads
protected

A pointer to the thread provider for the internal dispatcher (narrowphase).

Definition at line 352 of file physicsmanager.h.

debug::InternalDebugDrawer* Mezzanine::Physics::PhysicsManager::BulletDrawer
protected

A pointer to the debug drawer for rendering the physics world.

Definition at line 370 of file physicsmanager.h.

btSoftRigidDynamicsWorld* Mezzanine::Physics::PhysicsManager::BulletDynamicsWorld
protected

A pointer to the internal physics world.

Definition at line 367 of file physicsmanager.h.

btSequentialImpulseConstraintSolver* Mezzanine::Physics::PhysicsManager::BulletSolver
protected

A pointer to the internal constraint solver.

Definition at line 364 of file physicsmanager.h.

btThreadSupportInterface* Mezzanine::Physics::PhysicsManager::BulletSolverThreads
protected

A pointer to the thread provider for the internal constraint solver.

Definition at line 349 of file physicsmanager.h.

PhysicsManager * Mezzanine::Physics::PhysicsManager::CallBackWorld
staticprotected

The World that will be used for the InternalTickCallback.

Warning
The prevents two PhysicsManagers from running in two differen

Definition at line 398 of file physicsmanager.h.

CollisionMap Mezzanine::Physics::PhysicsManager::Collisions
protected

A container tracking all of the existing collisions in the physics world.

Definition at line 323 of file physicsmanager.h.

UIDGenerator Mezzanine::Physics::PhysicsManager::ConstraintIDGen
protected

Generator responsible for creating unique IDs for Constraint instances.

Definition at line 310 of file physicsmanager.h.

ConstraintContainer Mezzanine::Physics::PhysicsManager::Constraints
protected

A container storing all of the constraints owned by this manager.

Definition at line 317 of file physicsmanager.h.

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

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

Definition at line 380 of file physicsmanager.h.

Integer Mezzanine::Physics::PhysicsManager::DebugRenderMode
protected

The current rendering mode for the debug drawer.

Definition at line 333 of file physicsmanager.h.

btGhostPairCallback* Mezzanine::Physics::PhysicsManager::GhostCallback
protected

A pointer to the callback that enables ghost objects internally.

Definition at line 346 of file physicsmanager.h.

ProxyContainer Mezzanine::Physics::PhysicsManager::Proxies
protected

A container storing all of the proxies owned by this manager.

Definition at line 314 of file physicsmanager.h.

UIDGenerator Mezzanine::Physics::PhysicsManager::ProxyIDGen
protected

Generator responsible for creating unique IDs for CollidableProxy instances.

Definition at line 307 of file physicsmanager.h.

Boole Mezzanine::Physics::PhysicsManager::SimulationPaused
protected

Whether or not the physics simulation is to step each frame.

Definition at line 342 of file physicsmanager.h.

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

The work unit that does the stepping of the simulation.

Definition at line 374 of file physicsmanager.h.

Real Mezzanine::Physics::PhysicsManager::StepSize
protected

The amount of time (in seconds) a single simulation step should advance.

Definition at line 327 of file physicsmanager.h.

Whole Mezzanine::Physics::PhysicsManager::SubstepModifier
protected

A modifier that will determine how many substeps each frame the physics simulation should perform.

Definition at line 336 of file physicsmanager.h.

Whole Mezzanine::Physics::PhysicsManager::ThreadCount
protected

The number of threads the internal thread providers should allocate.

Definition at line 339 of file physicsmanager.h.

Real Mezzanine::Physics::PhysicsManager::TimeMultiplier
protected

A Multiplier that adjusts how fast physics runs relative to clock time.

Definition at line 330 of file physicsmanager.h.

WorldTriggerContainer Mezzanine::Physics::PhysicsManager::Triggers
protected

A container storing all of the worldtriggers owned by this manager.

Definition at line 320 of file physicsmanager.h.

ManagerConstructionInfo Mezzanine::Physics::PhysicsManager::WorldConstructionInfo
protected

A copy of the information used to initialize this manager.

Definition at line 303 of file physicsmanager.h.

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

The work unit that processes all world triggers.

Definition at line 377 of file physicsmanager.h.


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