1 #ifndef _KOHI_MATH_GEOMETRY_2D_H_
2 #define _KOHI_MATH_GEOMETRY_2D_H_
25 return point.
x >= rect.
x && point.
x <= rect.
x + rect.
width && point.
y >= rect.
y && point.
y <= rect.
y + rect.
height;
35 return point.
x >= rect.
x && point.
x <= rect.
x + rect.
width && point.
y >= rect.
y && point.
y <= rect.
y + rect.
height;
This file contains global type definitions which are used throughout the entire engine and applicatio...
_Bool b8
8-bit boolean type
Definition: defines.h:60
float f32
32-bit floating point number
Definition: defines.h:49
#define KINLINE
Inline qualifier.
Definition: defines.h:256
KINLINE b8 point_in_circle_2d(vec2 point, circle_2d circle)
Indicates if the provided point is within the given circle.
Definition: geometry_2d.h:44
KINLINE b8 point_in_rect_2d(vec2 point, rect_2d rect)
Indicates if the provided point is within the given rectangle.
Definition: geometry_2d.h:24
struct circle_2d circle_2d
Represents a two-dimensional circle in space.
KINLINE b8 point_in_rect_2di(vec2i point, rect_2di rect)
Indicates if the provided integer-based point is within the given integer-based rectangle.
Definition: geometry_2d.h:34
This file contains definitions for various important constant values as well as functions for many co...
KINLINE f32 vec2_distance_squared(vec2 vector_0, vec2 vector_1)
Returns the squared distance between vector_0 and vector_1. NOTE: If purely for comparison purposes,...
Definition: kmath.h:589
Contains various math types required for the engine.
Represents a two-dimensional circle in space.
Definition: geometry_2d.h:11
f32 radius
The radius of the circle.
Definition: geometry_2d.h:15
vec2 center
The center point of the circle.
Definition: geometry_2d.h:13
A 2-element vector.
Definition: math_types.h:31
f32 x
The first element.
Definition: math_types.h:37
f32 y
The second element.
Definition: math_types.h:47
A 2-element integer-based vector.
Definition: math_types.h:508
i32 y
The second element.
Definition: math_types.h:524
i32 x
The first element.
Definition: math_types.h:514
A 4-element vector.
Definition: math_types.h:229
f32 height
The fourth element.
Definition: math_types.h:268
f32 x
The first element.
Definition: math_types.h:236
f32 width
The third element.
Definition: math_types.h:258
f32 y
The second element.
Definition: math_types.h:244
A 4-element integer-based vector.
Definition: math_types.h:574
i32 y
The second element.
Definition: math_types.h:589
i32 height
The fourth element.
Definition: math_types.h:613
i32 width
The third element.
Definition: math_types.h:603
i32 x
The first element.
Definition: math_types.h:581