summaryrefslogtreecommitdiffhomepage
path: root/src/raycast.hpp
blob: acdddd338253fbbcea778842198053a8ebb6f3ca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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