74 [[nodiscard]]
bool isValid()
const {
return id != 0; }
113 std::uint32_t
id = 0;
Base class for collision shape components.
Component that manages a physics rigid body for an entity.
An Actor is similar to an Engine::Entities::Entity. An actor is an Entity with a transform.
bool fromString(const std::string &value, CollisionResponse &outResponse)
Parses a collision response config string.
CollisionEventType
Lifetime state for a collision or overlap pair.
@ Begin
Pair was absent on the previous physics step and is present now.
@ End
Pair was present on the previous physics step and is absent or invalidated now.
@ Stay
Pair was present on the previous physics step and is still present now.
CollisionResponse resolvePairResponse(CollisionResponse responseAB, CollisionResponse responseBA)
Resolves two directed profile responses into the final pair response.
CollisionResponse
Collision response selected for a pair of collision profiles.
@ Overlap
Contact callback without physical collision response.
@ Block
Physical collision response and contact callback.
@ Ignore
No contact callback and no physical collision response.
const char * toString(CollisionResponse response)
Converts a collision response to its config string.
CollisionProfile
Built-in collision profile enum registered by CollisionProfileRegistry::registerEngineProfiles().
@ OverlapAll
Overlaps every registered profile unless a config override changes the response.
@ Pawn
Player, NPC, or agent bodies controlled by gameplay code.
@ WorldStatic
Static level geometry and non-moving world collision.
@ IgnoreAll
Ignores every registered profile unless a config override changes the response.
@ BlockAll
Blocks every registered profile unless a config override changes the response.
@ WorldDynamic
Moving world objects that are not pawns.
Actor-level collision or overlap event generated by PhysicsEngine.
Entities::Actor * otherActor
Actor that owns otherBody, when available.
std::vector< Components::Collision * > selfComponents
Collision components on selfBody that contributed to the actor-level event.
CollisionEventType eventType
Pair lifetime state for this event.
Entities::Actor * selfActor
Actor that owns selfBody, when available.
Components::PhysicsBody * selfBody
Body receiving the callback.
CollisionResponse response
Resolved response for this pair.
Components::PhysicsBody * otherBody
Counterpart body, or nullptr for invalidation End events.
std::vector< Components::Collision * > otherComponents
Collision components on otherBody that contributed to the actor-level event.
Runtime handle for a registered collision component.
friend auto operator<=>(const CollisionHandle &, const CollisionHandle &)=default
Orders collision handles by id and generation.
friend bool operator==(const CollisionHandle &, const CollisionHandle &)=default
Compares collision handles by id and generation.
bool isValid() const
Checks whether this handle contains a collision slot and generation.
std::uint32_t generation
Slot generation used to reject stale handles.
Registry handle for a collision profile name.
bool isValid() const
Checks whether this handle refers to a registered profile slot.
friend bool operator==(const CollisionProfileHandle &, const CollisionProfileHandle &)=default
Compares profile handles by id.
friend auto operator<=>(const CollisionProfileHandle &, const CollisionProfileHandle &)=default
Orders profile handles by id.
Runtime handle for a registered physics body component.
bool isValid() const
Checks whether this handle contains a body slot and generation.
friend bool operator==(const PhysicsBodyHandle &, const PhysicsBodyHandle &)=default
Compares body handles by id and generation.
std::uint32_t generation
Slot generation used to reject stale handles.
friend auto operator<=>(const PhysicsBodyHandle &, const PhysicsBodyHandle &)=default
Orders body handles by id and generation.
Collision profile filter used by PhysicsEngine scene queries.
bool includeOverlaps
Accept candidates that resolve to CollisionResponse::Overlap.
bool includeBlocks
Accept candidates that resolve to CollisionResponse::Block.
CollisionProfileHandle profile
Query profile tested against candidate body collision profiles.