group2 0.1.0
CSE 125 Group 2
Loading...
Searching...
No Matches
physics::debug Namespace Reference

Classes

struct  Contact
 A single recorded contact event. More...

Enumerations

enum class  ContactSource : uint8_t {
  PlaneSweep = 0 , BoxSweep = 1 , BrushSweep = 2 , CylinderSweep = 3 ,
  SphereSweep = 4 , TriMeshSweep = 5 , PlaneDepen = 6 , BoxDepen = 7 ,
  BrushDepen = 8 , CylinderDepen = 9 , SphereDepen = 10 , TriMeshDepen = 11 ,
  Count = 12
}
 Source of a recorded contact, for filter / colour in the overlay. More...

Functions

void pushContact (const Contact &c) noexcept
 Push a contact event.
void pushSweepContact (glm::vec3 point, glm::vec3 normal, ContactSource source, uint32_t primitiveIndex=0) noexcept
 Convenience overload for non-depenetration (sweep) contacts.
void pushDepenContact (glm::vec3 point, glm::vec3 normal, float depth, ContactSource source, uint32_t primitiveIndex=0) noexcept
 Convenience overload for depenetration contacts (with depth).
void setEnabled (bool on) noexcept
 Enable / disable recording.
bool isEnabled () noexcept
 Query the recording flag. Internal fast-path predicate.
void beginFrame () noexcept
 Drain all thread-local buffers into the front buffer and clear them.
std::span< const Contactcontacts () noexcept
 Snapshot of all contacts pushed since the last beginFrame().

Enumeration Type Documentation

◆ ContactSource

enum class physics::debug::ContactSource : uint8_t
strong

Source of a recorded contact, for filter / colour in the overlay.

Enumerator
PlaneSweep 

Swept-AABB hit on an infinite plane.

BoxSweep 

Swept-AABB hit on a static AABB.

BrushSweep 

Swept-AABB hit on a convex brush.

CylinderSweep 

Swept-AABB hit on a vertical cylinder.

SphereSweep 

Swept-AABB hit on a sphere.

TriMeshSweep 

Swept-AABB hit on a triangle (mesh).

PlaneDepen 

Depenetration push out of plane overlap.

BoxDepen 

Depenetration push out of static AABB.

BrushDepen 

Depenetration push out of brush.

CylinderDepen 

Depenetration push out of cylinder.

SphereDepen 

Depenetration push out of sphere.

TriMeshDepen 

Depenetration push from a triangle MTV contribution.

Count 

Function Documentation

◆ beginFrame()

void physics::debug::beginFrame ( )
noexcept

Drain all thread-local buffers into the front buffer and clear them.

MUST be called exactly once per rendered frame from the main thread, BEFORE the next physics step starts. Calling concurrently with pushContact is UB.

Here is the caller graph for this function:

◆ contacts()

std::span< const Contact > physics::debug::contacts ( )
nodiscardnoexcept

Snapshot of all contacts pushed since the last beginFrame().

Stable until the next beginFrame(). Read-only.

Here is the caller graph for this function:

◆ isEnabled()

bool physics::debug::isEnabled ( )
nodiscardnoexcept

Query the recording flag. Internal fast-path predicate.

Here is the caller graph for this function:

◆ pushContact()

void physics::debug::pushContact ( const Contact & c)
noexcept

Push a contact event.

No-op when isEnabled() is false. Thread-safe: each thread accumulates into its own thread-local buffer.

◆ pushDepenContact()

void physics::debug::pushDepenContact ( glm::vec3 point,
glm::vec3 normal,
float depth,
ContactSource source,
uint32_t primitiveIndex )
noexcept

Convenience overload for depenetration contacts (with depth).

Here is the caller graph for this function:

◆ pushSweepContact()

void physics::debug::pushSweepContact ( glm::vec3 point,
glm::vec3 normal,
ContactSource source,
uint32_t primitiveIndex )
noexcept

Convenience overload for non-depenetration (sweep) contacts.

Here is the caller graph for this function:

◆ setEnabled()

void physics::debug::setEnabled ( bool on)
noexcept

Enable / disable recording.

When disabled, pushContact is a single relaxed atomic load + branch. Idempotent.

Here is the caller graph for this function: