cubos::engine::Collider struct

Component that identifies an entity as the owner of a Collider. Works with a CollisionShape (added separately).

Between intersecting colliders exist the relations: IntersectionStart. CollidingWith. IntersectionEnd.

Next is an example of how to use the relations associated with Colliders:

 cubos.system("exited area")
.after(collisionsTag)
.call([](Query<Entity, Collider&, IntersectionEnd&, Entity, Collider&> query,
         State& state) {
    for (auto [ent1, collider1, intersectionEnd, ent2, collider2] : query)
    {
         if (collider1.isArea && collider2.isStatic) {
             CUBOS_INFO("An area just stopped hitting a static collider. Disabling Area.");
             collider1.isActive = false;
         }
    }
});

Public variables

const bool isArea
Whether the collider is an Area.
const bool isStatic
Whether the Collider is Static.
bool isActive
Identities if a collider is active. When a Collider is not active, no collisions will be detected with it.

Variable documentation

const bool cubos::engine::Collider::isArea

Whether the collider is an Area.

An area collider detects collisions with other Colliders, however, collision manifolds are not generated.

Cannot be changed after creation.

const bool cubos::engine::Collider::isStatic

Whether the Collider is Static.

Used when it does not move, or its movement is limited. Static Colliders do not collide with each other.

Cannot be changed after creation.