]> git.lizzy.rs Git - nothing.git/blob - src/game/level/solid.h
(#639) Introduce rigid_bodies_collide_with_itself
[nothing.git] / src / game / level / solid.h
1 #ifndef SOLID_H_
2 #define SOLID_H_
3
4 #include "math/rect.h"
5
6 // TODO(#636): remove solid interface when it's not used anywhere anymore
7
8 typedef enum Solid_tag {
9     SOLID_PLATFORMS = 0,
10     SOLID_RIGID_RECT,
11     SOLID_PLAYER
12 } Solid_tag;
13
14 typedef struct Solid_ref {
15     Solid_tag tag;
16     void *ptr;
17 } Solid_ref;
18
19 /** \brief Answers what sides of the rectangular object the solid entity touches
20  */
21 void solid_touches_rect_sides(Solid_ref solid,
22                               Rect object,
23                               int sides[RECT_SIDE_N]);
24
25 /** \brief Applies a force vector to the solid body
26  */
27 void solid_apply_force(Solid_ref solid,
28                        Vec force);
29
30 void solid_collide_with_solid(Solid_ref solid,
31                               Solid_ref other_solid);
32
33 #endif  // SOLID_H_