Physics Engine Tutorial: Resolving Collisions with Linear Impulses

Added:

Relative Velocity
Normal Projection
Restitution Setup
Impulse Calculation
Loop Integration
Shape Setup
Bug Fixing
Manifold Data
Impulse Works
Next Features

Relative Velocity

0:00
Playing Section
  • 1

    Calculate relative velocity by subtracting one body's velocity from another.

  • 2

    Introduces the core concept for collision response using linear impulse.

  • 3

    Sets up the first step for resolving collisions between objects.

Vector Mathematics: A solid understanding of 2D/3D vector operations, specifically vector addition, subtraction, dot products, and normalization.
Newtonian Mechanics: Familiarity with Newton's Laws of Motion, linear momentum (p = mv), and the Impulse-Momentum Theorem.
Basic Collision Detection: Knowing how to detect intersections between simple shapes (like circles or AABBs) and identifying the collision normal.
Fundamental Programming: Experience with a general-purpose programming language (e.g., C++, C#, or JavaScript) and basic code structure.
Rotational Dynamics and Angular Impulses: Extending collision resolution to handle torque, angular velocity, and moment of inertia for off-center impacts.
Frictional Impulses: Implementing Coulomb friction models to simulate static and dynamic friction along the tangent of the collision normal.
Constraint Solvers: Exploring advanced iterative methods (like Projected Gauss-Seidel) to resolve simultaneous multi-body contacts and joints.
Continuous Collision Detection (CCD): Implementing techniques to prevent 'tunneling' where high-speed objects pass through boundaries between physics steps.
Spatial Partitioning: Optimizing the engine using Broad-Phase algorithms (such as Grid-based partitioning or Quadtrees) to handle hundreds of active colliders.
373 views17likes24:06@pixel_physicsOriginal Release: 2024-01-08

This tutorial demonstrates how to resolve simple linear collisions in a 2D physics engine by calculating relative velocity between colliding bodies, projecting it onto the penetration normal, computing the impulse magnitude using the formula J = -(1+e) * relative_velocity_along_normal / (1/massA + 1/massB), and applying equal-and-opposite impulse vectors to separate the bodies, where e represents the restitution coefficient controlling bounciness.