diff options
Diffstat (limited to 'src/math_helper.c')
| -rw-r--r-- | src/math_helper.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/math_helper.c b/src/math_helper.c index 51db867..900b8aa 100644 --- a/src/math_helper.c +++ b/src/math_helper.c @@ -140,4 +140,8 @@ box get_render_box_of_square(platform_window* window, vec3f position, vec3f size vec2f renderbl2 = (vec2f){render_x + info.px_incline*size.x, info.tile_height * position.y + info.tile_height*size.y - position.z*info.px_raised_per_h}; return (box){rendertl, rendertr, renderbl, renderbr, rendertl2, rendertr2, renderbl2, renderbr2}; +} + +bool rect_contains_point(vec2 point, vec2 tl, vec2 br) { + return (point.x >= tl.x && point.y >= tl.y && point.x <= br.x && point.y <= br.y); }
\ No newline at end of file |
