CollisionObject
Generated from engine/collision/collision_object.h at 862e08b. The text under each declaration is the header's own comment, word for word. About the reference says how these pages are made.
#include "engine/collision/collision_object.h" · namespace labrador
class CollisionObject
Section titled “class CollisionObject”A GameObject the collision module can see.
An interface that asks each object is_colliding(other) - "are you two overlapping?" - and, by way of the same predicate, "should you be tested at all?" delegates two questions the engine should keep: every class then answers the first with the same copied AABB-then-narrow block and the second with a hand-written type list, and the lists diverge (see collision_layer.h). Both are answered once, in find_contacts.
What is left is what only the object can know: its shape, which groups it belongs to and responds to, what it is in the game's own vocabulary, and what a contact means to it.
~CollisionObject
Section titled “~CollisionObject”The fine half of the pair GameObject::bounds() opens. bounds() is the coarse extent a broad phase indexes; this is the geometry the narrow phase measures. Never null.
layer · mask · tag
Section titled “layer · mask · tag”virtual CollisionLayer layer() const = 0;virtual CollisionMask mask() const = 0;virtual CollisionTag tag() const = 0;on_contact
Section titled “on_contact”Something overlapped this object, this frame.
normal is a unit vector pointing from this object towards other, and penetration is how far they overlap along it - so the two participants of one contact are told the same overlap with opposite normals, and each is told exactly once.
Separation is the game's call, not the engine's, which is why this hands over the measurement rather than the movement: a one-way platform separates only when the contact comes from above, a ramp separates vertically rather than along the slope, and a projectile does not separate at all - it dies. engine/collision/resolve.h has the arithmetic for the cases that do separate.
for_deletion
Section titled “for_deletion”virtual bool for_deletion() const = 0;Retired at the end of this tick. Objects flagged mid-frame generate no further contacts, so a projectile that hits a wall cannot also hit the player standing behind it.
set_for_deletion
Section titled “set_for_deletion”virtual void set_for_deletion(bool /*for_deletion*/);Requests removal at the end of the frame. Objects that are part of a level's fixed geometry (walls, platforms) cannot be removed and ignore this by default.
Related types
Section titled “Related types”Named in the public declarations above: GameObject, Shape, Vector2F.
In the samples and tests
Section titled “In the samples and tests”The files that include this header directly. A file can also reach it through another header.
samples/collision/body.htests/collision/broad_phase_tests.cpp,contacts_tests.cpp
Development documentation (unreleased). Built from Labrador 862e08b of 2026-10-08.