Collider struct
#include <engine/collisions/collider.hpp>
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
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.