sio2_physic.cc File Reference

#include "sio2.h"

Include dependency graph for sio2_physic.cc:


Functions

SIO2physicsio2PhysicInit (char *_name)
SIO2physicsio2PhysicFree (SIO2physic *_SIO2physic)
void sio2PhysicAddObject (SIO2physic *_SIO2physic, SIO2object *_SIO2object)
void sio2PhysicAddRigidBody (SIO2physic *_SIO2physic, SIO2object *_SIO2object)
void sio2PhysicAddSoftBody (SIO2physic *_SIO2physic, SIO2object *_SIO2object)
void sio2PhysicRemoveObject (SIO2physic *_SIO2physic, SIO2object *_SIO2object)
void sio2PhysicRemoveAllObjects (SIO2physic *_SIO2physic)
void sio2PhysicAddConstraint (SIO2physic *_SIO2physic, SIO2constraint *_SIO2constraint)
void sio2PhysicRemoveConstraint (SIO2physic *_SIO2physic, SIO2constraint *_SIO2constraint)
void sio2PhysicRemoveAllConstraints (SIO2physic *_SIO2physic)
void sio2PhysicSetWorldAttributes (SIO2physic *_SIO2physic, float _air_density, float _water_density, float _water_offset, vec3 *_water_normal)
void sio2PhysicSetGravity (SIO2physic *_SIO2physic, vec3 *_grav)
void sio2PhysicResetObject (SIO2physic *_SIO2physic, SIO2object *_SIO2object)
void sio2PhysicResetRigidBody (SIO2physic *_SIO2physic, btRigidBody *_btRigidBody, btCollisionObject *_btCollisionObject)
void sio2PhysicResetAll (SIO2physic *_SIO2physic)
void sio2PhysicPlay (SIO2physic *_SIO2physic)
void sio2PhysicPause (SIO2physic *_SIO2physic)
void sio2PhysicStop (SIO2physic *_SIO2physic)
void sio2PhysicRender (SIO2physic *_SIO2physic, float _timestep, int _pass)

Function Documentation

void sio2PhysicAddConstraint ( SIO2physic _SIO2physic,
SIO2constraint _SIO2constraint 
)

void sio2PhysicAddObject ( SIO2physic _SIO2physic,
SIO2object _SIO2object 
)

Add a new physic body to the SIO2physic world. Depending on the type of physic object that we are planning to add to the physic world, this function will analyze the _SIO2object->flags to determine which type of physic object we are trying to add and will dispatch the SIO2object to the appropriate function.

_SIO2physic: A valid SIO2physic pointer.
_SIO2object: A valid SIO2object pointer.

References SIO2object::flags, SIO2_OBJECT_SOFTBODY, sio2IsStateEnabled(), sio2PhysicAddRigidBody(), and sio2PhysicAddSoftBody().

Referenced by sio2ResourceBindAllPhysicObjects().

Here is the call graph for this function:

void sio2PhysicAddRigidBody ( SIO2physic _SIO2physic,
SIO2object _SIO2object 
)

void sio2PhysicAddSoftBody ( SIO2physic _SIO2physic,
SIO2object _SIO2object 
)

SIO2physic* sio2PhysicFree ( SIO2physic _SIO2physic  ) 

Free a valid SIO2physic pointer, and remove its handle from the global sio2 SIO2resource handle. This will also free all physic objects pointers (soft and rigid) and also all the constraints possibly added to the physic world.

_SIO2physic: A valid SIO2physic pointer.

return a NULL SIO2physic structure pointer.

References SIO2physic::_btBroadphaseInterface, SIO2physic::_btCollisionDispatcher, SIO2physic::_btConstraintSolver, SIO2physic::_btSoftBodyRigidBodyCollisionConfiguration, SIO2physic::_btSoftRigidDynamicsWorld, SIO2::_SIO2resource, sio2, SIO2_PHYSIC, sio2PhysicRemoveAllConstraints(), sio2PhysicRemoveAllObjects(), and sio2ResourceDel().

Referenced by sio2ResourceUnload().

Here is the call graph for this function:

SIO2physic* sio2PhysicInit ( char _name  ) 

void sio2PhysicPause ( SIO2physic _SIO2physic  ) 

Set the playback of the SIO2physic simulation loop to SIO2_PAUSE.

_SIO2physic: A valid SIO2physic pointer.

References SIO2_PAUSE, and SIO2physic::state.

void sio2PhysicPlay ( SIO2physic _SIO2physic  ) 

Set the playback of the SIO2physic simulation loop to SIO2_PLAY.

_SIO2physic: A valid SIO2physic pointer.

References SIO2_PLAY, and SIO2physic::state.

void sio2PhysicRemoveAllConstraints ( SIO2physic _SIO2physic  ) 

Remove ALL the physic constraints that have been added to the SIO2physic world.

_SIO2physic: A valid SIO2physic pointer.

References SIO2physic::_btSoftRigidDynamicsWorld.

Referenced by sio2PhysicFree().

void sio2PhysicRemoveAllObjects ( SIO2physic _SIO2physic  ) 

Remove ALL objects (either rigid or soft) from the SIO2physic world.

_SIO2physic: A valid SIO2physic pointer.

References SIO2physic::_btSoftRigidDynamicsWorld.

Referenced by sio2PhysicFree().

void sio2PhysicRemoveConstraint ( SIO2physic _SIO2physic,
SIO2constraint _SIO2constraint 
)

Remove an SIO2constraint from the physic world.

_SIO2physic: A valid SIO2physic pointer.
_SIO2constraint: A valid SIO2constraint pointer.

References SIO2physic::_btSoftRigidDynamicsWorld, and SIO2constraint::_btTypedConstraint.

void sio2PhysicRemoveObject ( SIO2physic _SIO2physic,
SIO2object _SIO2object 
)

Remove a physic object (either rigid or soft) from the SIO2physic world.

_SIO2physic: A valid SIO2physic pointer.
_SIO2object: A valid SIO2object pointer.

References SIO2objectphysic::_btRigidBody, SIO2objectphysic::_btSoftBody, SIO2physic::_btSoftRigidDynamicsWorld, and SIO2object::_SIO2objectphysic.

void sio2PhysicRender ( SIO2physic _SIO2physic,
float  _timestep,
int  _pass 
)

Increment the SIO2physic simulation step.

_SIO2physic: A valid SIO2physic pointer.
_timestep: The timestep uses to increment the physic simulation step.
_pass: The number of physic pass, the higher the more accurate.

References SIO2physic::_btSoftRigidDynamicsWorld, SIO2_PLAY, and SIO2physic::state.

void sio2PhysicResetAll ( SIO2physic _SIO2physic  ) 

Reset all rigid bodies back to their original locations.

_SIO2physic: A valid SIO2physic pointer.

References SIO2physic::_btSoftRigidDynamicsWorld, and sio2PhysicResetRigidBody().

Here is the call graph for this function:

void sio2PhysicResetObject ( SIO2physic _SIO2physic,
SIO2object _SIO2object 
)

Reset an SIO2object that uses collision back to its original position.

_SIO2physic: A valid SIO2physic pointer.
_SIO2object: A valid SIO2object pointer that uses physic.

References SIO2objectphysic::_btRigidBody, SIO2objectphysic::_btSoftBody, SIO2physic::_btSoftRigidDynamicsWorld, SIO2object::_SIO2objectphysic, and sio2PhysicResetRigidBody().

Here is the call graph for this function:

void sio2PhysicResetRigidBody ( SIO2physic _SIO2physic,
btRigidBody *  _btRigidBody,
btCollisionObject *  _btCollisionObject 
)

Reset a ridig/dynamic body back to its original position. This function is basically called internally by sio2PhysicResetObject, use that function instead of calling this one directly.

_SIO2physic: A valid SIO2physic pointer.
_btRigidBody: A valid btRigidBody pointer.
_btCollisionObject: A valid btCollisionObject pointer.

References SIO2physic::_btSoftRigidDynamicsWorld.

Referenced by sio2PhysicResetAll(), and sio2PhysicResetObject().

void sio2PhysicSetGravity ( SIO2physic _SIO2physic,
vec3 _grav 
)

Setup the gravity.

_SIO2physic: A valid SIO2physic pointer.
_grav: The direction & force of the gravity within the SIO2physic world.

References SIO2physic::_btSoftBodyWorldInfo, SIO2physic::_btSoftRigidDynamicsWorld, vec3::x, vec3::y, and vec3::z.

void sio2PhysicSetWorldAttributes ( SIO2physic _SIO2physic,
float  _air_density,
float  _water_density,
float  _water_offset,
vec3 _water_normal 
)

Set some extra world attributes.

_SIO2physic: A valid SIO2physic pointer.
_air_density: The density of the air.
_water_density: The density of the water.
_water_offset: The offset value used underwater.
_water_normal: The direction vector of the water.

References SIO2physic::_btSoftBodyWorldInfo, vec3::x, vec3::y, and vec3::z.

void sio2PhysicStop ( SIO2physic _SIO2physic  ) 

Set the playback of the SIO2physic simulation loop to SIO2_STOP.

_SIO2physic: A valid SIO2physic pointer.

References SIO2_STOP, and SIO2physic::state.


Generated on Thu Mar 4 15:41:45 2010 for SIO2 Engine by  doxygen 1.5.6