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

Per-pair contact manifold cache for warm-starting the solver. More...

#include "ecs/physics/ContactManifold.hpp"
#include <cstdint>
#include <unordered_map>
Include dependency graph for ContactCache.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  physics::ContactCache
struct  physics::ContactCache::Entry

Namespaces

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

Detailed Description

Per-pair contact manifold cache for warm-starting the solver.

Each frame:

  1. Narrow phase produces a fresh manifold per overlapping pair.
  2. merge() is called for each pair; if a cached manifold for the same pair exists, accumulated normal/tangent impulses are copied from cached points whose feature id matches. Otherwise the new points start with zero impulse.
  3. After the solver runs and applies impulses, the (now-warmed) manifolds are stored back into the cache for next frame.
  4. endFrame() removes any cached manifolds that weren't refreshed this frame (pair is no longer in contact).