Collision¶
Physics-based objects won't do much without an external force (such as gravity provided in many models). One such interaction is contact. At a high level iMSTK provides various objects for one to specify a collision between two objects.
PbdObjectCollision¶
Collision between two PBD simulated objects can be specified like so:
Both objects must contain a collision geometry
These collisions are two-way interactions. Whether it's a rigid or deformable (cloth, tissues). Both objects will experience reactions.
Note: Not all geometries collide with all other geometries. See the collision page for a chart on supported collisions.
PbdObjectCollision Parameters¶
PbdObjectCollision
supports friction, restitution, and contains a compliance/stiffness. It has appropriate defaults.
When rigid-rigid or rigid-deformable collisions are used one can supply the rigid body compliance to alter how "stiff" the collision is. 0 represents infinitely rigid collisions. In reality these are hard to keep stable. So a small epsilon of a compliance is often used. This parameter can also be used to loosen the collision greatly like a spring.
When deformable-deformable collisions are used one instead can supply a stiffness for each side of the collision. If one side of the collision objects is static/non-simulated then its deformable stiffness is zeroed out. Stiffness here can be seen as step size. With one step of the solver 1.0 is a valid. With multiple steps a smaller value is desirable to avoid overshooting.
Collision with Statics¶
Collisions with non-simulated objects is also supported, just supply a CollidingObject
to the PbdObjectCollision
on the right hand side:
RigidObjectCollision¶
Gives collision for RigidObject2
types. These are older deprecated types. It is setup in a similar way though.
It does not allow any compliance, the solver always converges to complete rigidity. It has a friction term, and a baumgarte stabilization term which can vary the restitution and effects the stiffness
of the collision. When high it will allow the object to penetrate more over a step but bounce more.
SphObjectCollision¶
Gives collision for SphObject
. Can only be used for collision between a SphObject
fluid and static CollidingObject
.
Collision Detection¶
For details on CollisionDetectionAlgorithm
, this page describes the geometric operations under the hood used to compute a collision. Collision can be used standalone if the user does not required resolution.
Which then produces CollisionData
for later usage.
Collision Handling¶
For details on PbdObjectCollision and implementations of resolution. Not neccesary for average users but can be helpful. A CollisionHandler
implements how to consume CollisionData
. iMSTK provides handling methods, typically these call upon the functions of a DynamicalModel to respond (explicit solve) or add something (such as a constraint) to later implicitly solve.