CS::Physics::Bullet::iDynamicSystem Struct Reference
The Bullet implementation of iDynamicSystem also implements this interface. More...
#include <ivaria/bullet.h>
Public Member Functions | |
virtual iTerrainCollider * | AttachColliderTerrain (iTerrainSystem *terrain, float minimumHeight=0, float maximumHeight=0)=0 |
Create a new terrain collider and add it to the simulation. | |
virtual iTerrainCollider * | AttachColliderTerrain (iTerrainCell *cell, float minimumHeight=0, float maximumHeight=0)=0 |
Create a new terrain collider and add it to the simulation. | |
virtual iTerrainCollider * | AttachColliderTerrain (csLockedHeightData &heightData, int gridWidth, int gridHeight, csVector3 gridSize, csOrthoTransform &transform, float minimumHeight=0, float maximumHeight=0)=0 |
Create a new terrain collider and add it to the simulation. | |
virtual iSoftBody * | CreateCloth (csVector3 corner1, csVector3 corner2, csVector3 corner3, csVector3 corner4, uint segmentCount1, uint segmentCount2, bool withDiagonals=false)=0 |
Create a soft body cloth. | |
virtual csPtr< iPivotJoint > | CreatePivotJoint ()=0 |
Create a pivot joint and add it to the simulation. | |
virtual iSoftBody * | CreateRope (csVector3 *vertices, size_t vertexCount)=0 |
Create a soft body rope with explicit positions of the vertices. | |
virtual iSoftBody * | CreateRope (csVector3 start, csVector3 end, uint segmentCount)=0 |
Create a soft body rope. | |
virtual iSoftBody * | CreateSoftBody (csVector3 *vertices, size_t vertexCount, csTriangle *triangles, size_t triangleCount)=0 |
Create a custom volumetric soft body. | |
virtual iSoftBody * | CreateSoftBody (iGeneralFactoryState *genmeshFactory, const csOrthoTransform &bodyTransform, MeshDuplicationMode duplicationMode=MESH_DUPLICATION_NONE)=0 |
Create a volumetric soft body from a genmesh. | |
virtual void | DebugDraw (iView *rview)=0 |
Draw the debug informations of the dynamic system. | |
virtual void | DestroyCollider (iTerrainCollider *collider)=0 |
Remove the given terrain collider from the simulation. | |
virtual void | DumpProfile (bool resetProfile=true)=0 |
Dump the profile information on the standard output. | |
virtual DebugMode | GetDebugMode ()=0 |
Return the current mode used when displaying debug informations. | |
virtual iSoftBody * | GetSoftBody (size_t index)=0 |
Return the soft body at the given index. | |
virtual size_t | GetSoftBodyCount ()=0 |
Return the number of soft bodies in this dynamic world. | |
virtual bool | GetSoftBodyWorld ()=0 |
Return whether this dynamic world can handle soft bodies or not. | |
virtual HitBeamResult | HitBeam (const csVector3 &start, const csVector3 &end)=0 |
Follow a beam from start to end and return the first body that is hit. | |
virtual void | RemovePivotJoint (iPivotJoint *joint)=0 |
Remove the given pivot joint from the simulation. | |
virtual void | RemoveSoftBody (iSoftBody *body)=0 |
Remove the given soft body from this dynamic world and delete it. | |
virtual bool | SaveBulletWorld (const char *filename)=0 |
Save the current state of the dynamic world in a .bullet serialization file. | |
virtual void | SetDebugMode (DebugMode mode)=0 |
Set the mode to be used when displaying debug informations. | |
virtual void | SetInternalScale (float scale)=0 |
Set the internal scale to be applied to the whole dynamic world. | |
virtual void | SetSoftBodyWorld (bool isSoftBodyWorld)=0 |
Set whether this dynamic world can handle soft bodies or not. | |
virtual void | SetStepParameters (float timeStep, size_t maxSteps, size_t iterations)=0 |
Set the parameters of the constraint solver. | |
virtual void | StartProfile ()=0 |
Start the profiling of the simulation. | |
virtual void | StopProfile ()=0 |
Stop the profiling of the simulation. |
Detailed Description
The Bullet implementation of iDynamicSystem also implements this interface.
- See also:
- iDynamicSystem iODEDynamicSystemState
Definition at line 160 of file bullet.h.
Member Function Documentation
virtual iTerrainCollider* CS::Physics::Bullet::iDynamicSystem::AttachColliderTerrain | ( | iTerrainSystem * | terrain, | |
float | minimumHeight = 0 , |
|||
float | maximumHeight = 0 | |||
) | [pure virtual] |
Create a new terrain collider and add it to the simulation.
This will create a collider for each cell of the terrain.
All the heights of the terrain must be kept between minimumHeight and maximumHeight, even when the terrain is deformed. If these values are not provided then they will be computed from the current state of the cell.
- Parameters:
-
terrain The terrain from which the colliders will be created minimumHeight The minimum height that will ever be contained in the height map maximumHeight The maximum height that will ever be contained in the height map
virtual iTerrainCollider* CS::Physics::Bullet::iDynamicSystem::AttachColliderTerrain | ( | iTerrainCell * | cell, | |
float | minimumHeight = 0 , |
|||
float | maximumHeight = 0 | |||
) | [pure virtual] |
Create a new terrain collider and add it to the simulation.
All the heights of the terrain must be kept between minimumHeight and maximumHeight, even when the terrain is deformed. If these values are not provided then they will be computed from the current state of the cell.
- Parameters:
-
cell The terrain cell from which the collider will be created minimumHeight The minimum height that will ever be contained in the height map maximumHeight The maximum height that will ever be contained in the height map
virtual iTerrainCollider* CS::Physics::Bullet::iDynamicSystem::AttachColliderTerrain | ( | csLockedHeightData & | heightData, | |
int | gridWidth, | |||
int | gridHeight, | |||
csVector3 | gridSize, | |||
csOrthoTransform & | transform, | |||
float | minimumHeight = 0 , |
|||
float | maximumHeight = 0 | |||
) | [pure virtual] |
Create a new terrain collider and add it to the simulation.
All the heights of the terrain must be kept between minimumHeight and maximumHeight, even when the terrain is deformed. If these values are not provided then they will be computed from the current state of the cell.
- Parameters:
-
heightData The height map of the terrain gridWidth The width of the height map data gridHeight The height of the height map data gridSize The size of the terrain, in world units transform The position of the terrain minimumHeight The minimum height that will ever be contained in the height map maximumHeight The maximum height that will ever be contained in the height map
virtual iSoftBody* CS::Physics::Bullet::iDynamicSystem::CreateCloth | ( | csVector3 | corner1, | |
csVector3 | corner2, | |||
csVector3 | corner3, | |||
csVector3 | corner4, | |||
uint | segmentCount1, | |||
uint | segmentCount2, | |||
bool | withDiagonals = false | |||
) | [pure virtual] |
Create a soft body cloth.
- Parameters:
-
corner1 The position of the top left corner. corner2 The position of the top right corner. corner3 The position of the bottom left corner. corner4 The position of the bottom right corner. segmentCount1 Number of horizontal segments in the cloth. segmentCount2 Number of vertical segments in the cloth. withDiagonals Whether there must be diagonal segments in the cloth or not. Diagonal segments will make the cloth more rigid.
- Remarks:
- You must call SetSoftBodyWorld() prior to this.
virtual csPtr<iPivotJoint> CS::Physics::Bullet::iDynamicSystem::CreatePivotJoint | ( | ) | [pure virtual] |
Create a pivot joint and add it to the simulation.
virtual iSoftBody* CS::Physics::Bullet::iDynamicSystem::CreateRope | ( | csVector3 * | vertices, | |
size_t | vertexCount | |||
) | [pure virtual] |
Create a soft body rope with explicit positions of the vertices.
- Parameters:
-
vertices The array of positions to use for the vertices. vertexCount The amount of vertices for the rope.
- Remarks:
- You must call SetSoftBodyWorld() prior to this.
virtual iSoftBody* CS::Physics::Bullet::iDynamicSystem::CreateRope | ( | csVector3 | start, | |
csVector3 | end, | |||
uint | segmentCount | |||
) | [pure virtual] |
Create a soft body rope.
- Parameters:
-
start Start position of the rope. end End position of the rope. segmentCount Number of segments in the rope.
- Remarks:
- You must call SetSoftBodyWorld() prior to this.
virtual iSoftBody* CS::Physics::Bullet::iDynamicSystem::CreateSoftBody | ( | csVector3 * | vertices, | |
size_t | vertexCount, | |||
csTriangle * | triangles, | |||
size_t | triangleCount | |||
) | [pure virtual] |
Create a custom volumetric soft body.
- Parameters:
-
vertices The vertices of the soft body. The position is absolute. vertexCount The count of vertices of the soft body. triangles The faces of the soft body. triangleCount The count of faces of the soft body.
- Remarks:
- You must call SetSoftBodyWorld() prior to this.
virtual iSoftBody* CS::Physics::Bullet::iDynamicSystem::CreateSoftBody | ( | iGeneralFactoryState * | genmeshFactory, | |
const csOrthoTransform & | bodyTransform, | |||
MeshDuplicationMode | duplicationMode = MESH_DUPLICATION_NONE | |||
) | [pure virtual] |
Create a volumetric soft body from a genmesh.
- Parameters:
-
genmeshFactory The genmesh factory to use. bodyTransform The initial transform of the soft body. duplicationMode The duplication mode of the mesh. This is useful for double sided meshes since it allows to create a soft body with an halfed count of vertices and triangles.
- Remarks:
- You must call SetSoftBodyWorld() prior to this.
virtual void CS::Physics::Bullet::iDynamicSystem::DebugDraw | ( | iView * | rview | ) | [pure virtual] |
Draw the debug informations of the dynamic system.
This has to be called at each frame, and will add 2D lines on top of the rendered scene. The objects to be displayed are defined by SetDebugMode().
virtual void CS::Physics::Bullet::iDynamicSystem::DestroyCollider | ( | iTerrainCollider * | collider | ) | [pure virtual] |
Remove the given terrain collider from the simulation.
virtual void CS::Physics::Bullet::iDynamicSystem::DumpProfile | ( | bool | resetProfile = true |
) | [pure virtual] |
Dump the profile information on the standard output.
StartProfile() must have been called before.
- Parameters:
-
resetProfile Whether or not the profile data must be reset after the dumping.
virtual DebugMode CS::Physics::Bullet::iDynamicSystem::GetDebugMode | ( | ) | [pure virtual] |
Return the current mode used when displaying debug informations.
virtual iSoftBody* CS::Physics::Bullet::iDynamicSystem::GetSoftBody | ( | size_t | index | ) | [pure virtual] |
Return the soft body at the given index.
virtual size_t CS::Physics::Bullet::iDynamicSystem::GetSoftBodyCount | ( | ) | [pure virtual] |
Return the number of soft bodies in this dynamic world.
virtual bool CS::Physics::Bullet::iDynamicSystem::GetSoftBodyWorld | ( | ) | [pure virtual] |
Return whether this dynamic world can handle soft bodies or not.
virtual HitBeamResult CS::Physics::Bullet::iDynamicSystem::HitBeam | ( | const csVector3 & | start, | |
const csVector3 & | end | |||
) | [pure virtual] |
Follow a beam from start to end and return the first body that is hit.
- Returns:
- True if a body was hit, false otherwise.
virtual void CS::Physics::Bullet::iDynamicSystem::RemovePivotJoint | ( | iPivotJoint * | joint | ) | [pure virtual] |
Remove the given pivot joint from the simulation.
virtual void CS::Physics::Bullet::iDynamicSystem::RemoveSoftBody | ( | iSoftBody * | body | ) | [pure virtual] |
Remove the given soft body from this dynamic world and delete it.
virtual bool CS::Physics::Bullet::iDynamicSystem::SaveBulletWorld | ( | const char * | filename | ) | [pure virtual] |
Save the current state of the dynamic world in a .bullet serialization file.
- Returns:
- True if the operation succeeds, false otherwise.
virtual void CS::Physics::Bullet::iDynamicSystem::SetDebugMode | ( | DebugMode | mode | ) | [pure virtual] |
Set the mode to be used when displaying debug informations.
The default value is 'CSPhysics::Bullet::DEBUG_COLLIDERS | CS::Physics::Bullet::DEBUG_JOINTS'.
- Remarks:
- Don't forget to call DebugDraw() at each frame to effectively display the debug informations.
virtual void CS::Physics::Bullet::iDynamicSystem::SetInternalScale | ( | float | scale | ) | [pure virtual] |
Set the internal scale to be applied to the whole dynamic world.
Use this to put back the range of dimensions you use for your objects to the one Bullet was designed for.
Bullet does not work well if the dimensions of your objects are smaller than 0.1 to 1.0 units or bigger than 10 to 100 units. Use this method to fix the problem.
- Warning:
- You have to call this method before adding any objects in the dynamic world, otherwise the objects won't have the same scale.
virtual void CS::Physics::Bullet::iDynamicSystem::SetSoftBodyWorld | ( | bool | isSoftBodyWorld | ) | [pure virtual] |
Set whether this dynamic world can handle soft bodies or not.
- Warning:
- You have to call this method before adding any objects in the dynamic world.
virtual void CS::Physics::Bullet::iDynamicSystem::SetStepParameters | ( | float | timeStep, | |
size_t | maxSteps, | |||
size_t | iterations | |||
) | [pure virtual] |
Set the parameters of the constraint solver.
Use this if you want to find a compromise between accuracy of the simulation and performance cost.
- Parameters:
-
timeStep The internal, constant, time step of the simulation, in seconds. A smaller value gives better accuracy. Default value is 1/60 s (ie 0.0166 s). maxSteps Maximum number of steps that Bullet is allowed to take each time you call iDynamicSystem::Step(). If you pass a very small time step as the first parameter, then you must increase the number of maxSteps to compensate for this, otherwise your simulation is 'losing' time. Default value is 1. If you pass maxSteps=0 to the function, then it will assume a variable tick rate. Don't do it. iterations Number of iterations of the constraint solver. A reasonable range of iterations is from 4 (low quality, good performance) to 20 (good quality, less but still reasonable performance). Default value is 10.
virtual void CS::Physics::Bullet::iDynamicSystem::StartProfile | ( | ) | [pure virtual] |
Start the profiling of the simulation.
This would add an overhead to the computations, but allows to display meaningful information on the behavior of the simulation.
virtual void CS::Physics::Bullet::iDynamicSystem::StopProfile | ( | ) | [pure virtual] |
Stop the profiling of the simulation.
This would add an overhead to the
The documentation for this struct was generated from the following file:
- ivaria/bullet.h
Generated for Crystal Space 2.0 by doxygen 1.6.1