Resources:
Part 1: Background
In this section, we first introduce the basics of PBD, including
- Equations of Motion
- Time Integration
- Constraints
🌟 Equations of Motion
Let’s start with a particle
, which has three attributes mass
, position
, velocity
.
From Newton’s second law, we know that the equation of motion of a particle is:
where is the sum of all forces acting on a particle . The relationship between and is:
From Particle → Rigid Body:
Compared to particles, except for 3 translational degrees of freedom, rigid bodies also have 3 rotational ones.
- Inertia tensor
- Orientation (a unit quaternion)
- Angular velocity .
Expand Newton’s second law to rigid bodies: viewing rigid bodies as a collection of infinite numbers of particles. The equations of motion for rigid bodies are also known as the Newton-Euler equations. The equation of motion for the rotational part of a rigid body:
where is the sum of all moments.
If the force acts at a point and is the center of mass of the body, the moment , also known as a pure moment.
The velocity kinematic relationship for the rotational part:
the quaternion .
🌟 Time Integration
A simulation step for an unconstrained particle or rigid body is performed by numerical integration of Equations (1)-(2)
or Equations (1)-(4)
, respectively. The most popular integration method in the field of position-based dynamics is the symplectic Euler method
, which uses the velocity at time for the integration of the position vector.
The time integration for a particle:
In the case of a rigid body:
☘️ Notice: the condition might be violated after the integration due to numerical errors. Since the quaternion represents a rotation, so it must be normalized after each step.
🌟 Constraints
Constraints are kinematic restrictions in the form of equations and inequalities that constrain the relative motion of bodies.
Equality
and inequality
constraints are referred to as bilateral and unilateral constraints, respectively.
PBD methods only consider constraints that depend on positions
and in the case of rigid bodies on orientations
.
A bilateral constraint is defined by a function
A unilateral constraint is defined by a function
where is a set of indices and is the cardinality of the constraint;
Force-based method:
✨ Define a potential energy
✨ Deriving the forces as (soft constraints)
✨ or via Lagrangian multipliers derived from constrained dynamics(hard constraints)
Position-based method
✨ modify the positions and orientations of the bodies directly in order to fulfill all constraints