Collision between objects is split in several phases, each implemented in a different component. Each phase is scheduled by a collision pipeline. The collision pipelines are executed in an animation loop.
The collision pipeline follows three steps:
- reset of the collision
- a collision detection
- a collision response
The visitor executes the following functions, each corresponding to a step of the pipeline:
Each of these functions will call a delegate, available in the Pipeline:
The 3 delegate functions describe the 3 different steps, and are usually overriden in derived classes. See an example in DefaultPipeline.
Notes: In some cases, the 3 steps are called manually by the animation loop through 3 dedicated visitors (CollisionResetVisitor, CollisionDetectionVisitor and CollisionResponseVisitor). Each of these visitors executes only one step (instead of the 3). This is to avoid race conditions in a multi-threaded environment.
Examples of Components
The following components are all collision pipelines, and can be placed in a simulation scene:
Read more on SOFA API documentation
Last modified: 28 September 2021