diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2024-02-04 11:05:17 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2024-02-04 11:05:17 +0100 |
commit | 7ed869ef78775ef34bb7db7832e53ab24f689688 (patch) | |
tree | c8340212c3c3a07f00e62174d682890752806c19 /src/raycast.hpp | |
parent | 9acc880b83724009eb55feaf9d4808d048966046 (diff) |
a
Diffstat (limited to 'src/raycast.hpp')
-rw-r--r-- | src/raycast.hpp | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/raycast.hpp b/src/raycast.hpp new file mode 100644 index 00000000..acdddd33 --- /dev/null +++ b/src/raycast.hpp @@ -0,0 +1,34 @@ +#pragma once +#include "src/object-id.hpp" +#include "src/collision.hpp" +#include "src/point.hpp" + +namespace floormat { + +class world; + +} // namespace floormat + +namespace floormat::rc { + +struct raycast_diag_s; + +struct raycast_result_s +{ + point from, to, collision; + collision_data collider; + bool has_result : 1 = false, + success : 1 = false; +}; + +[[nodiscard]] raycast_result_s raycast(world& w, point from, point to, object_id self); +[[nodiscard]] raycast_result_s raycast_with_diag(raycast_diag_s& diag, world& w, point from, point to, object_id self); + +} // namespace floormat::rc + +namespace floormat { + +using floormat::rc::raycast; +using floormat::rc::raycast_with_diag; + +} // namespace floormat |