CS::Physics::iPhysicalSystem Struct Reference
This is the interface for the actual plugin. More...
#include <ivaria/physics.h>

Public Member Functions | |
| virtual csPtr< iJointFactory > | CreateConeTwistJointFactory (float swingSpan1, float swingSpan2, float twistSpan)=0 |
| Create a cone twist joint for rigid bodies. | |
| virtual csPtr < iDynamicActorFactory > | CreateDynamicActorFactory (CS::Collisions::iCollider *collider=nullptr)=0 |
| Create a dynamic actor factory. | |
| virtual csPtr< iJointFactory > | CreateHingeJointFactory (float minAngle, float maxAngle, int axis)=0 |
| Create a hinge joint for rigid bodies. | |
| virtual csPtr< iJointFactory > | CreateJointFactory ()=0 |
| Create a general 6DOF joint. | |
| virtual csPtr< iJointFactory > | CreateP2PJointFactory ()=0 |
| Create a P2P joint for rigid bodies by setting the position in world space. | |
| virtual csPtr< iJointFactory > | CreatePivotJointFactory ()=0 |
| Create a pivot joint to attach to a rigid body to a position in world space in order to manipulate it. | |
| virtual csPtr< iRigidBodyFactory > | CreateRigidBodyFactory (CS::Collisions::iCollider *collider=nullptr)=0 |
| Create a rigid body factory. | |
| virtual csPtr< iJointFactory > | CreateSlideJointFactory (float minDist, float maxDist, float minAngle, float maxAngle, int axis)=0 |
| Create a slide joint for rigid bodies. | |
| virtual csPtr< iJointFactory > | CreateSoftAngularJointFactory (int axis)=0 |
| Create a angular joint for soft body by setting the rotation axis. | |
| virtual csPtr< iSoftClothFactory > | CreateSoftClothFactory ()=0 |
| Create a soft cloth factory. | |
| virtual csPtr< iJointFactory > | CreateSoftLinearJointFactory ()=0 |
| Create a linear joint for soft body by setting the position in world space. | |
| virtual csPtr< iSoftMeshFactory > | CreateSoftMeshFactory ()=0 |
| Create a soft mesh factory. | |
| virtual csPtr< iSoftRopeFactory > | CreateSoftRopeFactory ()=0 |
| Create a soft rope factory. | |
| virtual csPtr< iVehicleFactory > | CreateVehicleFactory (CS::Collisions::iCollider *collider=nullptr)=0 |
| Create a new factory to produce vehicles. | |
| virtual csPtr < iVehicleWheelFactory > | CreateVehicleWheelFactory ()=0 |
| Create a new factory to produce vehicle wheels. | |
| virtual void | DebugDraw (iGraphics3D *g3d, iCamera *camera)=0 |
| Draw the debug informations of the dynamic system. | |
| virtual void | DebugDraw (iView *rview)=0 |
| Draw the debug informations of the dynamic system. | |
| virtual void | DumpProfile (bool resetProfile=true)=0 |
| Dump the profile information on the standard output. | |
| virtual float | GetAngularDamping () const =0 |
| Get the global angular damping. | |
| virtual DebugMode | GetDebugMode ()=0 |
| Get the current mode used when displaying debug informations. | |
| virtual float | GetInternalScale () const =0 |
| Get the internal scale to be applied to the whole dynamic world. | |
| virtual float | GetLinearDamping () const =0 |
| Get the global linear damping. | |
| virtual bool | GetSoftBodyEnabled () const =0 |
| Return whether or not this physical system can handle soft bodies. | |
| virtual void | SetAngularDamping (float damping)=0 |
| Set the global angular damping of the whole system, that is for all subsequent collision sectors that will be created. | |
| virtual void | SetAutoDisableParams (float linear, float angular, float time)=0 |
| Set the parameters for AutoDisable. | |
| 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 | SetLinearDamping (float damping)=0 |
| Set the global linear damping of the whole system, that is for all subsequent collision sectors that will be created. | |
| virtual void | SetSoftBodyEnabled (bool enabled)=0 |
| Set whether or not this physical system can handle soft bodies. | |
| 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 | Step (csTicks duration)=0 |
| Step the simulation forward by the given duration (csTicks are in millisecond). | |
| virtual void | StopProfile ()=0 |
| Stop the profiling of the simulation. | |
Detailed Description
This is the interface for the actual plugin.
It is responsible for creating iPhysicalSector.
Main creators of instances implementing this interface:
- Bullet plugin (crystalspace.physics.bullet2)
Main ways to get pointers to this interface:
Main users of this interface:
- Dynamics loader plugin (crystalspace.dynamics.loader)
- See also:
- CS::Collisions::iCollisionSystem
Definition at line 1430 of file physics.h.
Member Function Documentation
| virtual csPtr<iJointFactory> CS::Physics::iPhysicalSystem::CreateConeTwistJointFactory | ( | float | swingSpan1, | |
| float | swingSpan2, | |||
| float | twistSpan | |||
| ) | [pure virtual] |
Create a cone twist joint for rigid bodies.
- Parameters:
-
trans The transform of the joint in world space. swingSpan1 The swing span the body can rotate around the local Z axis of joint. swingSpan2 The swing span the body can rotate around the local Y axis of joint. twistSpan The twist span the body can rotate around the local X axis of joint.
| virtual csPtr<iDynamicActorFactory> CS::Physics::iPhysicalSystem::CreateDynamicActorFactory | ( | CS::Collisions::iCollider * | collider = nullptr |
) | [pure virtual] |
Create a dynamic actor factory.
| virtual csPtr<iJointFactory> CS::Physics::iPhysicalSystem::CreateHingeJointFactory | ( | float | minAngle, | |
| float | maxAngle, | |||
| int | axis | |||
| ) | [pure virtual] |
Create a hinge joint for rigid bodies.
- Parameters:
-
position The position of the joint in world space. minAngle The min angle the body can rotate around the axis. maxAngle The max angle the body can rotate around the axis. axis The axis of the hinge, can only be 0, 1, 2.
| virtual csPtr<iJointFactory> CS::Physics::iPhysicalSystem::CreateJointFactory | ( | ) | [pure virtual] |
Create a general 6DOF joint.
| virtual csPtr<iJointFactory> CS::Physics::iPhysicalSystem::CreateP2PJointFactory | ( | ) | [pure virtual] |
Create a P2P joint for rigid bodies by setting the position in world space.
| virtual csPtr<iJointFactory> CS::Physics::iPhysicalSystem::CreatePivotJointFactory | ( | ) | [pure virtual] |
Create a pivot joint to attach to a rigid body to a position in world space in order to manipulate it.
| virtual csPtr<iRigidBodyFactory> CS::Physics::iPhysicalSystem::CreateRigidBodyFactory | ( | CS::Collisions::iCollider * | collider = nullptr |
) | [pure virtual] |
Create a rigid body factory.
| virtual csPtr<iJointFactory> CS::Physics::iPhysicalSystem::CreateSlideJointFactory | ( | float | minDist, | |
| float | maxDist, | |||
| float | minAngle, | |||
| float | maxAngle, | |||
| int | axis | |||
| ) | [pure virtual] |
Create a slide joint for rigid bodies.
- Parameters:
-
trans The transform of the joint in world space. minDist The min distance the body can move along the axis. maxDist The max distance the body can move along the axis. minAngle The min angle the body can rotate around the axis. maxAngle The max angle the body can rotate around the axis. axis The slide axis, can only be 0, 1, 2.
| virtual csPtr<iJointFactory> CS::Physics::iPhysicalSystem::CreateSoftAngularJointFactory | ( | int | axis | ) | [pure virtual] |
Create a angular joint for soft body by setting the rotation axis.
The axis can only be 0, 1, 2.
| virtual csPtr<iSoftClothFactory> CS::Physics::iPhysicalSystem::CreateSoftClothFactory | ( | ) | [pure virtual] |
Create a soft cloth factory.
| virtual csPtr<iJointFactory> CS::Physics::iPhysicalSystem::CreateSoftLinearJointFactory | ( | ) | [pure virtual] |
Create a linear joint for soft body by setting the position in world space.
| virtual csPtr<iSoftMeshFactory> CS::Physics::iPhysicalSystem::CreateSoftMeshFactory | ( | ) | [pure virtual] |
Create a soft mesh factory.
| virtual csPtr<iSoftRopeFactory> CS::Physics::iPhysicalSystem::CreateSoftRopeFactory | ( | ) | [pure virtual] |
Create a soft rope factory.
| virtual csPtr<iVehicleFactory> CS::Physics::iPhysicalSystem::CreateVehicleFactory | ( | CS::Collisions::iCollider * | collider = nullptr |
) | [pure virtual] |
Create a new factory to produce vehicles.
| virtual csPtr<iVehicleWheelFactory> CS::Physics::iPhysicalSystem::CreateVehicleWheelFactory | ( | ) | [pure virtual] |
Create a new factory to produce vehicle wheels.
| virtual void CS::Physics::iPhysicalSystem::DebugDraw | ( | iGraphics3D * | g3d, | |
| iCamera * | camera | |||
| ) | [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().
- Parameters:
-
g3d The 3D renderer camera The camera viewing the scene
| virtual void CS::Physics::iPhysicalSystem::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::iPhysicalSystem::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 float CS::Physics::iPhysicalSystem::GetAngularDamping | ( | ) | const [pure virtual] |
Get the global angular damping.
| virtual DebugMode CS::Physics::iPhysicalSystem::GetDebugMode | ( | ) | [pure virtual] |
Get the current mode used when displaying debug informations.
| virtual float CS::Physics::iPhysicalSystem::GetInternalScale | ( | ) | const [pure virtual] |
Get the internal scale to be applied to the whole dynamic world.
| virtual float CS::Physics::iPhysicalSystem::GetLinearDamping | ( | ) | const [pure virtual] |
Get the global linear damping.
| virtual bool CS::Physics::iPhysicalSystem::GetSoftBodyEnabled | ( | ) | const [pure virtual] |
Return whether or not this physical system can handle soft bodies.
| virtual void CS::Physics::iPhysicalSystem::SetAngularDamping | ( | float | damping | ) | [pure virtual] |
Set the global angular damping of the whole system, that is for all subsequent collision sectors that will be created.
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.1f.
| virtual void CS::Physics::iPhysicalSystem::SetAutoDisableParams | ( | float | linear, | |
| float | angular, | |||
| 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.
| virtual void CS::Physics::iPhysicalSystem::SetDebugMode | ( | DebugMode | mode | ) | [pure virtual] |
Set the mode to be used when displaying debug informations.
The default value is 'CSPhysics::DEBUG_COLLIDERS | CS::Physics::DEBUG_JOINTS'.
- Remarks:
- Don't forget to call DebugDraw() at each frame to effectively display the debug informations.
| virtual void CS::Physics::iPhysicalSystem::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 world, otherwise the objects won't have the same scale.
| virtual void CS::Physics::iPhysicalSystem::SetLinearDamping | ( | float | damping | ) | [pure virtual] |
Set the global linear damping of the whole system, that is for all subsequent collision sectors that will be created.
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.1f.
- See also:
- CS::Physics::iRigidBody::SetLinearDamping ()
| virtual void CS::Physics::iPhysicalSystem::SetSoftBodyEnabled | ( | bool | enabled | ) | [pure virtual] |
Set whether or not this physical system can handle soft bodies.
The default value is true.
- Warning:
- You have to call this method before creating any collision sectors.
| virtual void CS::Physics::iPhysicalSystem::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 iPhysicalSector::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::iPhysicalSystem::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::iPhysicalSystem::Step | ( | csTicks | duration | ) | [pure virtual] |
Step the simulation forward by the given duration (csTicks are in millisecond).
| virtual void CS::Physics::iPhysicalSystem::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/physics.h
Generated for Crystal Space 2.1 by doxygen 1.6.1
