Collision Constraints

In any physical simulation, preventing the interpenetration of objects is paramount for achieving plausible results. Position-Based Dynamics provides a unified approach to this challenge. Collisions are not treated as a separate post-processing step involving impulses or penalty forces; instead, they are formulated as unilateral inequality constraints, just like IPC [Li et al. 2020] and integrated directly into the core PBD solver loop.

Triangle Self-Collisions

For thin-shell objects like cloth or other deformable surfaces, a primary challenge is handling self-collision, where the object folds and interacts with itself. The most common scenario is a vertex penetrating a triangle from another part of the mesh. This interaction is modeled with a unilateral constraint involving all four participating particles.

Consider a vertex with position and a triangle with vertices . A collision constraint can be formulated by defining a minimum separation distance, or thickness , from the triangle plane. The unilateral constraint function is: where is the unit normal of the triangle. In case of , all four particles () are involved, and their positions are corrected according to their respective inverse masses to resolve the penetration while conserving momentum. It is also essential to check the barycentric coordinates of the vertex's projection onto the triangle plane to ensure the contact point lies within the triangle's boundaries before applying the correction.

Particle-Environment Collisions

The simplest collision scenario involves a dynamic particle interacting with a static, immovable piece of geometry, such as a floor plane or a convex container. This geometry acts as a boundary for the simulation domain. For a particle at position interacting with a static plane, the non-penetration condition can be formulated as a constraint on the particle's signed distance from the plane.

Let the plane be defined such that for any point on it, where is the unit normal and is an offset. A non-penetration constraint for a particle is then written as an inequality: When a particle violates this constraint (i.e., ), the PBD solver projects its position back to the surface. Since only one particle is dynamic, its inverse mass is effectively infinite compared to the static geometry, so it receives the full position correction required to satisfy . The correction simply moves the particle along the plane normal to resolve the penetration. You can imagine how this can be simply extended to more complex shapes.

Particle-Particle Collisions

For simulating systems composed of discrete elements, such as granular materials, we have to consider direct particle-particle collision. This constraint prevents any two particles from overlapping.

For two particles at positions and with corresponding radii and , the non-penetration constraint is a simple inequality based on their center-to-center distance: Unlike the linear plane constraint, this function is non-linear. This can be solved similarly to the stretching constraints considered in the previous section. The solver calculates a correction that pushes the two particles apart along the vector connecting their centers, distributing the correction based on their inverse masses to conserve linear momentum.

Frictional Effects at the Position Level

Friction is a dissipative contact force that opposes relative tangential motion between surfaces. To be more robust we can incorporate friction directly into the position-level constraint solve. This method is applied after an interpenetration constraint between two particles, and , has been resolved.

Let and be the particle positions at the start of the time step. Let and be the current candidate positions, which have already been corrected to resolve penetration. The core idea is to compute a frictional position correction that opposes the tangential component of the particles' relative displacement during the timestep.

First, we determine the relative displacement vector over the timestep, : Next, we find the tangential component of this displacement, , by projecting it onto the contact plane defined by the contact normal . The friction model determines the magnitude of the correction based on a comparison between the tangential displacement and the static friction threshold, which is proportional to the penetration depth and the coefficient of static friction .

A position correction vector, , is calculated to oppose . This correction is then distributed between the two particles. The correction for particle is given by: where is the inverse mass and is the coefficient of kinetic friction. The negative sign is crucial, as friction must oppose the tangential displacement. In the static case, the correction fully cancels out the relative tangential movement. In the kinetic case, the correction is limited by the kinetic friction force (Coulomb's law).