class
#include <engine/collisions/raycast.hpp>
Raycast System argument which allows performing raycast queries among all entities with colliders.
An example of using this system argument:
cubos.system("do raycast") .call([](Raycast raycast) { if (auto hit = raycast.fire({origin, direction})) { CUBOS_INFO("Hit {} at {}", hit->entity, hit->point); } });
Public types
Constructors, destructors, conversion operators
- Raycast(Query<Entity, const LocalToWorld&, const BoxCollisionShape&> boxes, Query<Entity, const LocalToWorld&, const CapsuleCollisionShape&, const Position&> capsules)
- Constructs.
Public functions
Function documentation
cubos:: engine:: Raycast:: Raycast(Query<Entity, const LocalToWorld&, const BoxCollisionShape&> boxes,
Query<Entity, const LocalToWorld&, const CapsuleCollisionShape&, const Position&> capsules)
Constructs.
Parameters | |
---|---|
boxes | Query for entities with box colliders. |
capsules | Query for entities with capsule colliders. |