CrystalSpace

Public API Reference

iDynamicSystem Struct Reference

This is the interface for the dynamics core. More...

#include <ivaria/dynamics.h>

Inheritance diagram for iDynamicSystem:

List of all members.

Public Member Functions

virtual void AddBody (iRigidBody *body)=0
 Add a rigid body to this dynamic system after having removed it from any previous one.
virtual void AddJoint (iJoint *joint)=0
 Add a joint to this dynamic system after having removed it from any previous one.
virtual void AttachCollider (iDynamicsSystemCollider *collider)=0
 Attach collider to dynamic system.
virtual bool AttachColliderBox (const csVector3 &size, const csOrthoTransform &trans, float friction, float elasticity, float softness=0.01f)=0
 Attach a static box collider to the dynamic system.
virtual bool AttachColliderCapsule (float length, float radius, const csOrthoTransform &trans, float friction, float elasticity, float softness=0.01f)=0
 Attach a static capsule collider to the dynamic system (oriented along it's Z axis).
virtual bool AttachColliderConvexMesh (iMeshWrapper *mesh, const csOrthoTransform &trans, float friction, float elasticity, float softness=0.01f)=0
 Attach a static convex collider to the dynamic system.
virtual bool AttachColliderCylinder (float length, float radius, const csOrthoTransform &trans, float friction, float elasticity, float softness=0.01f)=0
 Attach a static cylinder collider to the dynamic system (oriented along it's Z axis).
virtual bool AttachColliderMesh (iMeshWrapper *mesh, const csOrthoTransform &trans, float friction, float elasticity, float softness=0.01f)=0
 Attach a static concave collider to the dynamic system.
virtual bool AttachColliderPlane (const csPlane3 &plane, float friction, float elasticity, float softness=0.01f)=0
 Attach a static plane collider to the dynamic system.
virtual bool AttachColliderSphere (float radius, const csVector3 &offset, float friction, float elasticity, float softness=0.01f)=0
 Attach a static sphere collider to the dynamic system.
virtual bool AutoDisableEnabled ()=0
 Return whether the AutoDisable is on or off.
virtual csPtr< iRigidBodyCreateBody ()=0
 Create a rigid body and add it to the simulation.
virtual csRef
< iDynamicsSystemCollider
CreateCollider ()=0
 Create static collider and put it into simulation.
virtual csPtr< iBodyGroupCreateGroup ()=0
 Create a body group. Bodies in a same group don't collide with each other.
virtual csPtr< iJointCreateJoint ()=0
 Create a joint and add it to the simulation.
virtual void DestroyCollider (iDynamicsSystemCollider *collider)=0
 Destroy static collider.
virtual void DestroyColliders ()=0
 Destroy all static colliders.
virtual void EnableAutoDisable (bool enable)=0
 Turn on/off AutoDisable functionality.
virtual iRigidBodyFindBody (const char *name)=0
 Find a body within a system.
virtual iRigidBodyGetBody (unsigned int index)=0
 Get Rigid Body by its index.
virtual int GetBodysCount ()=0
 Get the count of rigid bodies.
virtual csRef
< iDynamicsSystemCollider
GetCollider (unsigned int index)=0
 Get static collider.
virtual int GetColliderCount ()=0
 Get the count of static colliders.
virtual iDynamicsMoveCallbackGetDefaultMoveCallback ()=0
 Get the default move callback.
virtual const csVector3 GetGravity () const =0
 Get the global gravity.
virtual float GetLinearDampener () const =0
 Get the global linear dampener setting.
virtual float GetRollingDampener () const =0
 Get the global rolling dampener setting.
virtual iObjectQueryObject (void)=0
 Return the underlying object.
virtual void RemoveBody (iRigidBody *body)=0
 Remove a rigid body from the simulation.
virtual void RemoveGroup (iBodyGroup *group)=0
 Remove a group from a simulation. Those bodies now collide.
virtual void RemoveJoint (iJoint *joint)=0
 Remove a joint from the simulation.
virtual void SetAutoDisableParams (float linear, float angular, int steps, float time)=0
 Set the parameters for AutoDisable.
virtual void SetGravity (const csVector3 &v)=0
 Set the global gravity.
virtual void SetLinearDampener (float d)=0
 Set the global linear dampener.
virtual void SetRollingDampener (float d)=0
 Set the global angular dampener.
virtual void Step (float stepsize)=0
 Step the simulation forward by stepsize.

Detailed Description

This is the interface for the dynamics core.

It handles all bookkeeping for rigid bodies and joints. It also handles collision response. Collision detection is done in another plugin.

Main creators of instances implementing this interface:

Main ways to get pointers to this interface:

See also:
CS::Physics::Bullet::iDynamicSystem iODEDynamicSystemState CS::Debug::iDynamicSystemDebugger

Definition at line 131 of file dynamics.h.


Member Function Documentation

virtual void iDynamicSystem::AddBody ( iRigidBody body  )  [pure virtual]

Add a rigid body to this dynamic system after having removed it from any previous one.

Warning:
For the Bullet plugin, it won't work if you use dynamic systems which have different internal scales set through CS::Physics::Bullet::iDynamicSystem::SetInternalScale().
virtual void iDynamicSystem::AddJoint ( iJoint joint  )  [pure virtual]

Add a joint to this dynamic system after having removed it from any previous one.

virtual void iDynamicSystem::AttachCollider ( iDynamicsSystemCollider collider  )  [pure virtual]

Attach collider to dynamic system.

virtual bool iDynamicSystem::AttachColliderBox ( const csVector3 size,
const csOrthoTransform trans,
float  friction,
float  elasticity,
float  softness = 0.01f 
) [pure virtual]

Attach a static box collider to the dynamic system.

Parameters:
size the box size along each axis
trans a hard transform to apply to the mesh
friction how much friction this body has, ranges from 0 (no friction) to infinity (perfect friction)
elasticity the "bouncyness" of this object, from 0 (no bounce) to 1 (maximum bouncyness)
softness how "squishy" this object is, in the range 0...1; small values (range of 0.00001 to 0.01) give reasonably stiff collision contacts, larger values are more "mushy"
virtual bool iDynamicSystem::AttachColliderCapsule ( float  length,
float  radius,
const csOrthoTransform trans,
float  friction,
float  elasticity,
float  softness = 0.01f 
) [pure virtual]

Attach a static capsule collider to the dynamic system (oriented along it's Z axis).

A capsule is a cylinder with an halph-sphere at each end. It is less costly to compute collisions with a capsule than with a cylinder.

Parameters:
length the capsule length along the axis (i.e. the distance between the two halph-sphere's centers)
radius the capsule radius
trans a hard transform to apply to the mesh
friction how much friction this body has, ranges from 0 (no friction) to infinity (perfect friction)
elasticity the "bouncyness" of this object, from 0 (no bounce) to 1 (maximum bouncyness)
softness how "squishy" this object is, in the range 0...1; small values (range of 0.00001 to 0.01) give reasonably stiff collision contacts, larger values are more "mushy"
virtual bool iDynamicSystem::AttachColliderConvexMesh ( iMeshWrapper mesh,
const csOrthoTransform trans,
float  friction,
float  elasticity,
float  softness = 0.01f 
) [pure virtual]

Attach a static convex collider to the dynamic system.

Parameters:
mesh the mesh to use for collision detection. This mesh must be convex.
trans a hard transform to apply to the mesh
friction how much friction this body has, ranges from 0 (no friction) to infinity (perfect friction)
elasticity the "bouncyness" of this object, from 0 (no bounce) to 1 (maximum bouncyness)
softness how "squishy" this object is, in the range 0...1; small values (range of 0.00001 to 0.01) give reasonably stiff collision contacts, larger values are more "mushy"
virtual bool iDynamicSystem::AttachColliderCylinder ( float  length,
float  radius,
const csOrthoTransform trans,
float  friction,
float  elasticity,
float  softness = 0.01f 
) [pure virtual]

Attach a static cylinder collider to the dynamic system (oriented along it's Z axis).

Parameters:
length the cylinder length along the axis
radius the cylinder radius
trans a hard transform to apply to the mesh
friction how much friction this body has, ranges from 0 (no friction) to infinity (perfect friction)
elasticity the "bouncyness" of this object, from 0 (no bounce) to 1 (maximum bouncyness)
softness how "squishy" this object is, in the range 0...1; small values (range of 0.00001 to 0.01) give reasonably stiff collision contacts, larger values are more "mushy"
virtual bool iDynamicSystem::AttachColliderMesh ( iMeshWrapper mesh,
const csOrthoTransform trans,
float  friction,
float  elasticity,
float  softness = 0.01f 
) [pure virtual]

Attach a static concave collider to the dynamic system.

Concave colliders should be avoided because it is most costly to compute the collisions with them, and the simulation of their movement is less stable. It is safer to use a combination of convex colliders.

Parameters:
mesh the mesh to use for collision detection
trans a hard transform to apply to the mesh
friction how much friction this body has, ranges from 0 (no friction) to infinity (perfect friction)
elasticity the "bouncyness" of this object, from 0 (no bounce) to 1 (maximum bouncyness)
softness how "squishy" this object is, in the range 0...1; small values (range of 0.00001 to 0.01) give reasonably stiff collision contacts, larger values are more "mushy"
virtual bool iDynamicSystem::AttachColliderPlane ( const csPlane3 plane,
float  friction,
float  elasticity,
float  softness = 0.01f 
) [pure virtual]

Attach a static plane collider to the dynamic system.

Parameters:
plane describes the plane to added
friction how much friction this body has, ranges from 0 (no friction) to infinity (perfect friction)
elasticity the "bouncyness" of this object, from 0 (no bounce) to 1 (maximum bouncyness)
softness how "squishy" this object is, in the range 0...1; small values (range of 0.00001 to 0.01) give reasonably stiff collision contacts, larger values are more "mushy"
virtual bool iDynamicSystem::AttachColliderSphere ( float  radius,
const csVector3 offset,
float  friction,
float  elasticity,
float  softness = 0.01f 
) [pure virtual]

Attach a static sphere collider to the dynamic system.

Parameters:
radius the radius of the sphere
offset a translation of the sphere's center from the default (0,0,0)
friction how much friction this body has, ranges from 0 (no friction) to infinity (perfect friction)
elasticity the "bouncyness" of this object, from 0 (no bounce) to 1 (maximum bouncyness)
softness how "squishy" this object is, in the range 0...1; small values (range of 0.00001 to 0.01) give reasonably stiff collision contacts, larger values are more "mushy"
virtual bool iDynamicSystem::AutoDisableEnabled (  )  [pure virtual]

Return whether the AutoDisable is on or off.

virtual csPtr<iRigidBody> iDynamicSystem::CreateBody (  )  [pure virtual]

Create a rigid body and add it to the simulation.

virtual csRef<iDynamicsSystemCollider> iDynamicSystem::CreateCollider (  )  [pure virtual]

Create static collider and put it into simulation.

After collision it will remain in the same place, but it will affect collided dynamic colliders (to make it dynamic, just attach it to a rigid body).

virtual csPtr<iBodyGroup> iDynamicSystem::CreateGroup (  )  [pure virtual]

Create a body group. Bodies in a same group don't collide with each other.

virtual csPtr<iJoint> iDynamicSystem::CreateJoint (  )  [pure virtual]

Create a joint and add it to the simulation.

virtual void iDynamicSystem::DestroyCollider ( iDynamicsSystemCollider collider  )  [pure virtual]

Destroy static collider.

virtual void iDynamicSystem::DestroyColliders (  )  [pure virtual]

Destroy all static colliders.

virtual void iDynamicSystem::EnableAutoDisable ( bool  enable  )  [pure virtual]

Turn on/off AutoDisable functionality.

AutoDisable will stop moving objects if they are stable in order to save processing time. By default this is enabled.

virtual iRigidBody* iDynamicSystem::FindBody ( const char *  name  )  [pure virtual]

Find a body within a system.

virtual iRigidBody* iDynamicSystem::GetBody ( unsigned int  index  )  [pure virtual]

Get Rigid Body by its index.

virtual int iDynamicSystem::GetBodysCount (  )  [pure virtual]

Get the count of rigid bodies.

virtual csRef<iDynamicsSystemCollider> iDynamicSystem::GetCollider ( unsigned int  index  )  [pure virtual]

Get static collider.

virtual int iDynamicSystem::GetColliderCount (  )  [pure virtual]

Get the count of static colliders.

virtual iDynamicsMoveCallback* iDynamicSystem::GetDefaultMoveCallback (  )  [pure virtual]

Get the default move callback.

virtual const csVector3 iDynamicSystem::GetGravity (  )  const [pure virtual]

Get the global gravity.

virtual float iDynamicSystem::GetLinearDampener (  )  const [pure virtual]

Get the global linear dampener setting.

virtual float iDynamicSystem::GetRollingDampener (  )  const [pure virtual]

Get the global rolling dampener setting.

virtual iObject* iDynamicSystem::QueryObject ( void   )  [pure virtual]

Return the underlying object.

virtual void iDynamicSystem::RemoveBody ( iRigidBody body  )  [pure virtual]

Remove a rigid body from the simulation.

virtual void iDynamicSystem::RemoveGroup ( iBodyGroup group  )  [pure virtual]

Remove a group from a simulation. Those bodies now collide.

virtual void iDynamicSystem::RemoveJoint ( iJoint joint  )  [pure virtual]

Remove a joint from the simulation.

virtual void iDynamicSystem::SetAutoDisableParams ( float  linear,
float  angular,
int  steps,
float  time 
) [pure virtual]

Set the parameters for AutoDisable.

Parameters:
linear Maximum linear movement to disable a body. Default value is 0.8.
angular Maximum angular movement to disable a body. Default value is 1.0.
steps Minimum number of steps the body meets linear and angular requirements before it is disabled. Default value is 0.
time Minimum time the body needs to meet linear and angular movement requirements before it is disabled. Default value is 0.0.
Remarks:
With the Bullet plugin, the 'steps' parameter is ignored.
With the Bullet plugin, calling this method will not affect bodies already created.
virtual void iDynamicSystem::SetGravity ( const csVector3 v  )  [pure virtual]

Set the global gravity.

virtual void iDynamicSystem::SetLinearDampener ( float  d  )  [pure virtual]

Set the global linear dampener.

The dampening correspond to how much the movements of the objects will be reduced. It is a value between 0 and 1, giving the ratio of speed that will be reduced in one second. 0 means that the movement will not be reduced, while 1 means that the object will not move. The default value is 0.

See also:
CS::Physics::Bullet::iRigidBody::SetLinearDampener()
virtual void iDynamicSystem::SetRollingDampener ( float  d  )  [pure virtual]

Set the global angular dampener.

The dampening correspond to how much the movements of the objects will be reduced. It is a value between 0 and 1, giving the ratio of speed that will be reduced in one second. 0 means that the movement will not be reduced, while 1 means that the object will not move. The default value is 0.

See also:
CS::Physics::Bullet::iRigidBody::SetRollingDampener()
virtual void iDynamicSystem::Step ( float  stepsize  )  [pure virtual]

Step the simulation forward by stepsize.


The documentation for this struct was generated from the following file:

Generated for Crystal Space 2.1 by doxygen 1.6.1