SOFA implements a series of collision primitives called CollisionModel. A CollisionModel contains a list of same-type elements. It can be part of a list of CollisionModels or a hierarchy. Here is a list of them:
See the detailed description of the CollisionModel class.
All collision models define the following data:
- active: boolean defining if the CollisionModel should be considered in the detection
- moving: boolean defining if the object associated to this CollisionModel might move during the simulation. In most cases, moving being false prevents the unnecessary recomputation of the bounding tree, which is a mandatory step for some broad or narrow phases collision detection.
- simulated: boolean defining if this CollisionModel is attached to a simulation. It is false for immobile or procedurally animated objects that don’t use contact forces (no Penalty or InteractionConstraint created). Usually, two colliding objects having simulated being false are not considered in collision detection. Self-collision is not considered if simulated is false. If one of two colliding objects has simulated being false, the contact response is created as a child of the other.
- selfCollision: boolean defining if the object can self collide
- group: integer ID corresponding to the groups containing this model. No collision can occur between collision models included in a common group (e.g. allowing the same object to have multiple collision models). See info about collision group
If you are using a collision response using the Penalty method, the following data will be also used:
- contactStiffness: defining the stiffness coefficient which will be used to compute the penalty force using the interpenetration distance (value) resulting from the collision detection.
To use a CollisionModel, you must first make sure that the collision node in which the CollisionModel is defined does contain the associated topology (e.g. TriangleSetTopologyContainer if you want to use the TriangleCollisionModel).
Moreover, the collision model is usually mapped to a node containing the mechanical representation of the object. The collision node should therefore include a mapping.
This component is used as follows in XML format:
<TriangleCollisionModel simulated="1" contactStiffness="100" selfCollision="0" group="1"/>
or using SofaPython3:
'TriangleCollisionModel', simulated='1', contactStiffness='100', selfCollision='0', group='1')node.addObject(
An example scene involving a TriangleCollisionModel is available in examples/Components/collision/TriangleModel.scn
Last modified: 26 October 2023