#include <Physics.h>
Inherits DigitalSpaces::DIObjectBase.
In general usage, a developer should only need to use this interface for setting up collision listeners. The creation of a DIPhysicsWorld should be handled through the SceneGraph, which will create a single default DIPhysicsWorld if given physics related parameters in the <environment> configuration section of a .scene file. Most simulations will not need to run more then 1 physics world at a time, as objects connot interact between worlds at all.
When accessed through scripting, this DInterface also contains:
void SetContactsBetweenShapes( const std::set<std::string>& setA, const std::set<std::string>& setB, const tSettingDict& settingDict )
set<string> is provided via a Python set (of strings), and tSettingDict is a Python dict of string to vector/quaternion/bool/float values. This function should be integrated into the interface at a binary level, in future.
Public Member Functions | |
| float | GetGlobalScale () |
| Get the internal scaling of the physics simulation. | |
| void | GetCollisionsLastHeartbeat (DIStringPairList *collidedShapes) |
| A helper method for when using a DIPhysicsShapeCollisionListener isn't practical. | |
| DIPhysicsRay * | CreateRay (const char *name) |
| Create a ray for testing against a physics world. | |
| DIPhysicsRay * | FindRay (const char *name) |
| Retreive a ray that was previously created. | |
| void | DestroyRay (const char *name) |
| Destroy a previously created ray. | |
Physics World Functions | |
| DIPhysicsWorld * | CreateWorld (const char *sWorldName) |
| Create a physics world for simulation. | |
| DIPhysicsWorld * | FindWorld (const char *sWorldName) |
| Return a physics world that was previously created. | |
| void | DestroyWorld (DIPhysicsWorld *pWorld) |
| Destroy a physics world. | |
Listener Functions | |
| void | AddBodyMovementListener (DIPhysicsBodyMovementListener *listener) |
| void | AddShapeCollisionListener (DIPhysicsShapeCollisionListener *listener) |
| Allows an implementation to gather information about collisions as they occur, and to customize the simulations reaction to the collision. | |
| void | AddWorldStepListener (DIPhysicsWorldStepListener *listener) |
| DIPhysicsWorld* DigitalSpaces::DIPhysics::CreateWorld | ( | const char * | sWorldName | ) |
Create a physics world for simulation.
| sWorldName | A unique name for the physics world. |
| DIPhysicsWorld* DigitalSpaces::DIPhysics::FindWorld | ( | const char * | sWorldName | ) |
Return a physics world that was previously created.
| sWorldName | Unique name to search for. |
| void DigitalSpaces::DIPhysics::DestroyWorld | ( | DIPhysicsWorld * | pWorld | ) |
Destroy a physics world.
| pWorld | Interface to an existing world, retreived with CreateWorld or FindWorld. |
| void DigitalSpaces::DIPhysics::AddBodyMovementListener | ( | DIPhysicsBodyMovementListener * | listener | ) |
| void DigitalSpaces::DIPhysics::AddShapeCollisionListener | ( | DIPhysicsShapeCollisionListener * | listener | ) |
Allows an implementation to gather information about collisions as they occur, and to customize the simulations reaction to the collision.
When any collisions occur, in any worlds, the object implementation DIPhysicsShapeCollisionListener will be called with an interface that provides both information about the collision, and functions to set how the simulation will react.
| void DigitalSpaces::DIPhysics::AddWorldStepListener | ( | DIPhysicsWorldStepListener * | listener | ) |
| float DigitalSpaces::DIPhysics::GetGlobalScale | ( | ) |
Get the internal scaling of the physics simulation.
| void DigitalSpaces::DIPhysics::GetCollisionsLastHeartbeat | ( | DIStringPairList * | collidedShapes | ) |
A helper method for when using a DIPhysicsShapeCollisionListener isn't practical.
Also useful for when you will never be changing the simulations reaction at the time of collision, and are only collecting data about what happened.
| DIPhysicsRay* DigitalSpaces::DIPhysics::CreateRay | ( | const char * | name | ) |
Create a ray for testing against a physics world.
| name | Unique identifier for the ray. |
| DIPhysicsRay* DigitalSpaces::DIPhysics::FindRay | ( | const char * | name | ) |
Retreive a ray that was previously created.
| name | Unique name of a ray. |
| void DigitalSpaces::DIPhysics::DestroyRay | ( | const char * | name | ) |
Destroy a previously created ray.
| name | Unique name of a ray. |
1.5.6