logo


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 ii, which has three attributes mass mim_i, position xi\bold x_i, velocity vi\bold v_i.

From Newton’s second law, we know that the equation of motion of a particle is:

vi˙=1mifi\begin{align}\dot {\bold v_i} = \frac{1}{m_i}\bold f_i\end{align}

where fi\bold f_i is the sum of all forces acting on a particle ii. The relationship between x˙\dot {\bold x} and v˙\dot {\bold v} is:

xi˙=vi\begin{align}\dot {\bold x_i} = \bold v_i\end{align}

From Particle → Rigid Body:

Compared to particles, except for 3 translational degrees of freedom, rigid bodies also have 3 rotational ones.

  • Inertia tensor IiR3×3\bold I_i \in \mathbb R^{3\times 3}
  • Orientation (a unit quaternion) qiH\bold q_i \in \mathbb H
  • Angular velocity ωiR3\omega_i \in \mathbb R^3.

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:

ωi˙=Ii1(τi(ωi×(Iiωi)))\begin{align}\dot {\bold \omega_i} = \bold I_i^{-1}(\tau_i - (\omega_i \times(\bold I_i \omega_i)))\end{align}

where τi\tau_i is the sum of all moments.

If the force f\bold f acts at a point p\bold p and x\bold x is the center of mass of the body, the moment τ=(px)×f\tau = (\bold p - \bold x) \times \bold f, also known as a pure moment.

The velocity kinematic relationship for the rotational part:

qi˙=12ω~iqi\begin{align}\dot {\bold q_i} = \frac{1}{2}\tilde \omega_i \bold q_i\end{align}

ω~\tilde \omega the quaternion [0,ωix,ωiy,ωiz][0, \omega_i^x, \omega_i^y, \omega_i^z].

🌟 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 t0+Δtt_0 + \Delta t for the integration of the position vector.

The time integration for a particle:

vi(t0+Δt)=vi(t0)+Δt1mifi(t0)xi(t0+Δt)=xi(t0)+Δtvi(t0+Δt)\bold v_i(t_0 + \Delta t) = \bold v_i(t_0) + \Delta t \frac{1}{m_i}\bold f_i(t_0) \\ \bold x_i(t_0 + \Delta t) = \bold x_i(t_0) + \Delta t \bold v_i(t_0 + \Delta t)

In the case of a rigid body:

ωi(t0+Δt)=ωi(t0)+ΔtIi1(t0)(τi(t0)(ωi(t0)×(Ii(t0)ωi(t0))))q(t0+Δt)=q(t0)+Δt12ω~i(t0+Δt)qi(t0)q=1\begin{aligned} \bold \omega_i(t_0 + \Delta t) &= \bold \omega_i(t_0) + \Delta t \bold I_i^{-1}(t_0)(\tau_i(t_0) - (\omega_i(t_0) \times(\bold I_i(t_0) \omega_i(t_0)))) \\ \bold q(t_0 + \Delta t) &= \bold q(t_0) + \Delta t\frac{1}{2}\tilde \omega_i(t_0 + \Delta t) \bold q_i(t_0) \\ ||\bold q|| &= 1 \end{aligned}

☘️ Notice: the condition q=1||\bold q|| = 1 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

C(xi1,qi1,...,xinj,qinj)=0C(\bold x_{i1}, \bold q_{i1},..., \bold x_{in_j}, \bold q_{in_j}) = 0

A unilateral constraint is defined by a function

C(xi1,qi1,...,xinj,qinj)0C(\bold x_{i1}, \bold q_{i1},..., \bold x_{in_j}, \bold q_{in_j}) \geq 0

where {i1,,inj}\{i_1, …, i_{n_j}\} is a set of indices and njn_j is the cardinality of the constraint;

Force-based method:

✨ Define a potential energy E=k2C2E = \frac{k}{2}C^2

✨ Deriving the forces as f=E\bold f = -\nabla E(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

PreBack to BlogNext