contact_events.h
| File Path | engine/include/conjure/physics/contact_events.h |
| API ↗ | Physics, The physics world and queries |
Contact events. physics_world::contact_events() returns the events of the last step sorted by ascending (bodyIdA, bodyIdB), then kind: per pair per step at most one ENTER / STAY (or TRIGGER_ENTER) and at most one EXIT (or TRIGGER_EXIT), the exit after the enter. Consumers reporting to b flip the normal. Destroying a body in contact synthesises its EXIT / TRIGGER_EXIT, reported by the next step and naming the body's entity. When the body went because that entity was destroyed, the entity is no longer alive: check world::is_alive before touching a participant. The entity's generation keeps the dead id from matching a reused slot, so no later event references it.
Structs
| File | Description |
|---|---|
contact_event |
One contact event. 48 bytes, trivially copyable. |
Enumerations
contact_kind
What happened to a body pair in the step. Trigger pairs report only the TRIGGER_ kinds.
Functions
Public
to_string
to_string[[nodiscard]] CONJURE_API std::string_view to_string(
contact_kind kind) noexcept;The upper-case enumerator name of a kind ("ENTER"); "UNKNOWN" for out-of-range values.