![]() |
Leviathan
0.8.0.0
Leviathan game engine
|
#include <PhysicalWorld.h>
Public Member Functions | |
DLLEXPORT | PhysicalWorld (GameWorld *owner, PhysicsMaterialManager *physicscallbacks) |
DLLEXPORT | ~PhysicalWorld () |
DLLEXPORT void | SimulateWorld (float secondspassed, int maxsubsteps=4) |
Advances the simulation the specified amount of time. More... | |
DLLEXPORT PhysicsShape::pointer | CreateCompound () |
DLLEXPORT PhysicsShape::pointer | CreateSphere (float radius) |
DLLEXPORT PhysicsShape::pointer | CreateBox (float xdimension, float ydimension, float zdimension) |
The dimensions are halfwidths of the box along each axis. More... | |
DLLEXPORT PhysicsBody::pointer | CreateBodyFromCollision (const PhysicsShape::pointer &shape, float mass, PhysicsPositionProvider *positionsynchronization, int physicsmaterialid=-1) |
Constraints body to a 2d plane of movement specified by its normal. More... | |
DLLEXPORT bool | ChangeBodyShape (const PhysicsBody::pointer &body, const PhysicsShape::pointer &shape) |
Applies a changed shape to a body. More... | |
DLLEXPORT bool | DestroyBody (PhysicsBody *body) |
Destroys a physics body. More... | |
const PhysMaterialDataPair * | GetMaterialPair (int id1, int id2) const |
Finds the information for contact between objects with two materials. More... | |
DLLEXPORT GameWorld * | GetGameWorld () |
PhysicsShape * | CreateSphereWrapper (float radius) |
PhysicsShape * | CreateCompoundWrapper () |
Protected Member Functions | |
void | OnManifoldWithContact (btPersistentManifold *contactManifold, const btManifoldPoint &contactPoint, const btCollisionObject *objA, const btCollisionObject *objB) |
Calls appropriate material callbacks. This is called once per contact manifold that has penetrating points. More... | |
Static Protected Member Functions | |
static void | OnPhysicsSubStep (btDynamicsWorld *world, btScalar timeStep) |
Protected Attributes | |
float | PassedTimeTotal = 0 |
Total amount of seconds required to be simulated. More... | |
GameWorld * | OwningWorld |
PhysicsMaterialManager * | PhysicsMaterials |
bool | PhysicsUpdateInProgress = false |
This is a small sanity check for preventing destroying physics bodies during a tick. More... | |
std::unique_ptr< btDefaultCollisionConfiguration > | CollisionConfiguration |
std::unique_ptr< btCollisionDispatcher > | Dispatcher |
std::unique_ptr< btBroadphaseInterface > | OverlappingPairCache |
std::unique_ptr< btSequentialImpulseConstraintSolver > | Solver |
std::unique_ptr< btDiscreteDynamicsWorld > | DynamicsWorld |
std::unique_ptr< LeviathanPhysicsOverlapFilter > | OverlapFilter |
std::vector< PhysicsBody::pointer > | PhysicsBodies |
We need to keep the physic bodies alive (guaranteed) until they are destroyed. More... | |
Definition at line 56 of file PhysicalWorld.h.
DLLEXPORT PhysicalWorld::PhysicalWorld | ( | GameWorld * | owner, |
PhysicsMaterialManager * | physicscallbacks | ||
) |
Definition at line 74 of file PhysicalWorld.cpp.
DLLEXPORT PhysicalWorld::~PhysicalWorld | ( | ) |
Definition at line 111 of file PhysicalWorld.cpp.
DLLEXPORT bool PhysicalWorld::ChangeBodyShape | ( | const PhysicsBody::pointer & | body, |
const PhysicsShape::pointer & | shape | ||
) |
Applies a changed shape to a body.
Definition at line 359 of file PhysicalWorld.cpp.
DLLEXPORT PhysicsBody::pointer PhysicalWorld::CreateBodyFromCollision | ( | const PhysicsShape::pointer & | shape, |
float | mass, | ||
PhysicsPositionProvider * | positionsynchronization, | ||
int | physicsmaterialid = -1 |
||
) |
Constraints body to a 2d plane of movement specified by its normal.
mass | If 0 then this is a static body |
Definition at line 284 of file PhysicalWorld.cpp.
DLLEXPORT PhysicsShape::pointer PhysicalWorld::CreateBox | ( | float | xdimension, |
float | ydimension, | ||
float | zdimension | ||
) |
The dimensions are halfwidths of the box along each axis.
Definition at line 277 of file PhysicalWorld.cpp.
DLLEXPORT PhysicsShape::pointer PhysicalWorld::CreateCompound | ( | ) |
Definition at line 259 of file PhysicalWorld.cpp.
|
inline |
Definition at line 125 of file PhysicalWorld.h.
DLLEXPORT PhysicsShape::pointer PhysicalWorld::CreateSphere | ( | float | radius | ) |
Definition at line 264 of file PhysicalWorld.cpp.
|
inline |
Definition at line 115 of file PhysicalWorld.h.
DLLEXPORT bool PhysicalWorld::DestroyBody | ( | PhysicsBody * | body | ) |
Destroys a physics body.
May not be called while a physics update is in progress
Definition at line 400 of file PhysicalWorld.cpp.
Definition at line 107 of file PhysicalWorld.h.
const PhysMaterialDataPair * PhysicalWorld::GetMaterialPair | ( | int | id1, |
int | id2 | ||
) | const |
Finds the information for contact between objects with two materials.
Definition at line 211 of file PhysicalWorld.cpp.
|
protected |
Calls appropriate material callbacks. This is called once per contact manifold that has penetrating points.
Definition at line 180 of file PhysicalWorld.cpp.
|
staticprotected |
Definition at line 136 of file PhysicalWorld.cpp.
DLLEXPORT void PhysicalWorld::SimulateWorld | ( | float | secondspassed, |
int | maxsubsteps = 4 |
||
) |
Advances the simulation the specified amount of time.
Definition at line 127 of file PhysicalWorld.cpp.
|
protected |
Definition at line 155 of file PhysicalWorld.h.
|
protected |
Definition at line 157 of file PhysicalWorld.h.
|
protected |
Definition at line 163 of file PhysicalWorld.h.
|
protected |
Definition at line 165 of file PhysicalWorld.h.
|
protected |
Definition at line 159 of file PhysicalWorld.h.
|
protected |
Definition at line 148 of file PhysicalWorld.h.
|
protected |
Total amount of seconds required to be simulated.
Definition at line 146 of file PhysicalWorld.h.
|
protected |
We need to keep the physic bodies alive (guaranteed) until they are destroyed.
Definition at line 168 of file PhysicalWorld.h.
|
protected |
Definition at line 149 of file PhysicalWorld.h.
|
protected |
This is a small sanity check for preventing destroying physics bodies during a tick.
Definition at line 152 of file PhysicalWorld.h.
|
protected |
Definition at line 161 of file PhysicalWorld.h.