group2 0.1.0
CSE 125 Group 2
Loading...
Searching...
No Matches
ContactManifold.hpp File Reference

Multi-point contact manifold + persistent contact cache. More...

#include "ecs/physics/SurfaceType.hpp"
#include <array>
#include <cstdint>
#include <entt/entt.hpp>
#include <glm/vec3.hpp>
Include dependency graph for ContactManifold.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  physics::ContactFeatureId
 Identifier built from "which feature of A" and "which feature of B" met at this contact. More...
struct  physics::ContactPoint
 One sub-contact in a multi-point manifold. More...
struct  physics::ContactManifold
 A contact manifold between exactly two entities. More...

Namespaces

namespace  physics
 Pure physics math — no ECS types, no registry.

Variables

constexpr int physics::k_maxContactPoints = 4
 Up to 4 points per body pair — enough for any flat-face contact (box-on-box, box-on-ground, etc.).

Detailed Description

Multi-point contact manifold + persistent contact cache.

Up to 4 contact points per body pair, stable across frames so the sequential-impulse solver in Phase 10 can warm-start its impulses from last frame's converged solution.

Data layout mirrors Box2D / Bullet:

  • One world-space contact normal (points from A → B).
  • Per-point world position, depth, and accumulated normal / tangent impulses (carried across frames for warm-start).
  • A "feature id" per point so we can match this frame's points to last frame's even when contact geometry slides slightly.