Explicit Euler continuously injects artificial mechanical energy ($E(t) \to \infty$), so spring oscillations grow without bound and Kepler orbits spiral outward into space. Semi-Implicit Euler and Verlet conserve phase-space volume (symplectic), bounding the energy even for large $\Delta t$.
Penalty Method ($F = -kd$) exhibits high stiffness instability when the natural frequency reaches $\omega \Delta t > 2$, triggering explosive numerical amplification. Sequential Impulse keeps the system rigid but drifts without Baumgarte feedback ($\vec{b} = \frac{\beta}{\Delta t} C$).
Iterative solvers relax distance constraints locally. With only 1–2 iterations, tension cannot propagate down the chain, so rigid steel links stretch like elastic rubber. More iterations stiffen the chain towards truly inextensible behaviour.
Measures link stretch $||\vec{x}_i - \vec{x}_{i+1}|| - L_0$. With few iteration passes, gravitational tension accumulates in the centre.
When the displacement per frame ($\vec{v} \Delta t$) exceeds the barrier thickness $w$, Discrete Collision Detection completely misses the obstacle: the object is on the left at $t_n$ and on the right at $t_{n+1}$. Continuous Collision Detection (CCD) sweeps the ray segment to intercept fast movers.
A collision obeys $\sum \vec{p}_i^- = \sum \vec{p}_i^+$ regardless of the material, while the kinetic energy removed is fixed by the coefficient of restitution $e = \frac{|\vec{v}_1^+ - \vec{v}_2^+|}{\vec{v}_1^- - \vec{v}_2^-}$. Angular motion follows the same pattern with $L = I\omega$.
The same points, three interpretations. A point particle is just position, mass and velocity. A rigid body adds the rule that every distance stays constant. A soft body keeps the topology but allows deformation inside elastic constraints.
Drag any point to deform or throw the body.
Drag the white cue ball and release to strike it with an impulse $\vec{J} = \Delta\vec{p} = m\,\Delta\vec{v}$. Change the cue mass and watch how the same impulse produces a different velocity while total momentum is always conserved.
Yellow = velocity, red (top) = total momentum. Pull the cue ball back and release.
Complex meshes are never tested directly. A proxy volume is fitted to the shape; tighter volumes reject false positives but cost more to build and maintain. The fit % is the shape area divided by the volume area.
AABB is cheapest but loose under rotation. An OBB hugs the shape at the cost of an orientation. The convex hull is exact for convex shapes but cannot represent concavities — much like a mesh collider.
Testing every pair costs $O(n^2)$ — impossible for large scenes. A uniform grid (a BVH in disguise) keeps only pairs that share a cell as candidates; the narrow phase then runs the exact test on that short list.
A stack of crates solved with sequential impulses. Drag from anywhere to aim and release to launch; every moving body shows its velocity vector, so you can follow momentum through the collision network as the structure comes down.
Failure mode: with the naive contact solver a fast ball can penetrate a crate, wedge between two blocks and jitter forever. Tick Robust contacts to fix the circle/box contact normal, add a penetration slop and a restitution threshold.
A 3D mass-spring sheet (structural, shear and bend springs) held by its top edge. Switch between the raw vertex mesh and the shaded surface lit with real normals. Drag a vertex to pull it — springs that stretch past the tear limit snap.
Tip: pull a vertex downwards past the tear limit to rip the fabric.
Particles kept at a rest density by position-based relaxation. Three views reveal the layers: raw points, points with their interaction radii and forces, and the shaded water. Click inside the water to shove it around; click empty space to add more water there.
A humanoid of particles (joints) linked by bones (distance constraints); shared particles form the revolute joints. Grab any joint to pose or throw it, and watch the joints work.
A brittle glass (or cup) is pre-fractured into convex shards by recursive half-plane splits. Click it (or press Shatter) to break it into rigid debris that flies apart, spins and settles — then grab and throw the shards with the mouse.
Lecture 6 — Mathematical Formulations & Variable Glossary
Reference guide matching the slides and lecture notes from IZHV — Space and Bodies. Every equation is paired with a short dictionary defining the variable, its dimension and its role in a game engine.
1. Newtonian Dynamics
Slide 2- $\vec{F}$ (Force): Net vector force ($N = kg \cdot m/s^2$).
- $m$ (Mass): Inertial resistance to acceleration ($kg$). Distinct from weight ($mg$).
- $\vec{a}$ (Acceleration): Second time derivative of position ($\vec{a} = \frac{d^2\vec{s}}{dt^2}$, $m/s^2$).
- $\vec{p}$ (Linear Momentum): Quantity of motion ($kg \cdot m/s$). Conserved in closed systems.
- $\vec{v}^-, \vec{v}^+$: Pre-collision ($-$) and post-collision ($+$) velocities.
2. Angular Motion & Torque
Slide 3- $\vec{\tau}$ (Torque): Rotational equivalent of force ($N \cdot m$).
- $\vec{d}$ (Lever Arm): Vector from center of mass to the application point ($m$).
- $\mathbf{I}$ (Inertia Tensor): Mass-distribution matrix ($kg \cdot m^2$).
- $\vec{\alpha}$ (Angular Acceleration): Rate of change of angular velocity ($rad/s^2$).
- $\vec{\omega}$ (Angular Velocity): Rotation rate and axis ($rad/s$).
3. Numerical Integrator Schemes
Slides 7–9- $\Delta t$ (Time Step): Discretisation interval ($s$). Usually fixed in game loops (e.g. 0.02s).
- $\vec{s}_n, \vec{s}_{n+1}$: Positions at steps $n$ and $n+1$.
- $\vec{s}_{n-1}$: Previous position in Verlet. Makes it time-reversible.
4. Constraints & Baumgarte Bias
Slides 10–11- $C(\vec{s})$ (Constraint): Position metric ($C=0$ when satisfied).
- $\mathbf{J}$ (Jacobian): Constraint derivative row vector ($\partial C / \partial \vec{s}$).
- $\lambda$ (Lagrange Multiplier): Required impulse magnitude along $\mathbf{J}$.
- $\vec{b}$ (Baumgarte Bias): Velocity offset eliminating position drift.
- $\beta$ (Baumgarte Factor): Stabilisation gain ($0.1 \le \beta \le 0.3$).
5. Collision Detection & Volumes
Slide 14- AABB: axis-aligned box — cheapest, loose under rotation.
- OBB: oriented box — tighter, needs an orientation.
- Sphere / Ellipse: rotation invariant, cheap distance tests.
- Convex / Mesh: exact but expensive; concavity not represented by the hull.
6. Broad & Narrow Phase
Slide 15- Broad phase: Bounding Volume Hierarchy prunes the pair list.
- BSP / kD-tree: split space along (axis-aligned) planes.
- Quadtree / Octree: recursive 4-way (2D) / 8-way (3D) subdivision.
- Narrow phase: exact tests return contact points, normals and distances.
7. Constraint Solvers
Slide 16- Sequential Impulse: Box2D; iterate & accumulate $\lambda$ (clamp after accumulation).
- Projected Gauss-Seidel: solves the MLCP explicitly.
- Temporal Gauss-Seidel: Unity; split $\Delta t$ into $n$ sub-steps of $\Delta t / n$.
- $e$ (Restitution): energy removed on impact, $0$ = putty, $1$ = perfectly elastic.
8. Physics Engine Phase Loop & Unity
Slides 12–20- Fixed time step keeps the integration stable; results are synced back to the game world.
- Broad phase (pairs) then narrow phase (contacts) then the solver.
- Engines: Havok · PhysX · Box2D · Bullet.
- Unity 2D (Box2D): Rigidbody2D + Box/Circle/Edge/Polygon colliders.
- Unity 3D (PhysX): Rigidbody + Box/Sphere/Capsule/Mesh colliders.
- DOTS: stateless Unity Physics vs cached Havok; PhysicsBody/Shape authoring.