Kohi Game Engine
geometry_2d.h File Reference
#include "defines.h"
#include "kmath.h"
#include "math_types.h"

Go to the source code of this file.

Data Structures

struct  circle_2d
 Represents a two-dimensional circle in space. More...
 

Typedefs

typedef struct circle_2d circle_2d
 Represents a two-dimensional circle in space. More...
 

Functions

KINLINE b8 point_in_rect_2d (vec2 point, rect_2d rect)
 Indicates if the provided point is within the given rectangle. More...
 
KINLINE b8 point_in_circle_2d (vec2 point, circle_2d circle)
 Indicates if the provided point is within the given circle. More...
 

Typedef Documentation

◆ circle_2d

typedef struct circle_2d circle_2d

Represents a two-dimensional circle in space.

Function Documentation

◆ point_in_circle_2d()

KINLINE b8 point_in_circle_2d ( vec2  point,
circle_2d  circle 
)

Indicates if the provided point is within the given circle.

Parameters
pointThe point to check.
rectThe rectangle to check against.
Returns
True if the point is within the rectangle; otherwise false.

◆ point_in_rect_2d()

KINLINE b8 point_in_rect_2d ( vec2  point,
rect_2d  rect 
)

Indicates if the provided point is within the given rectangle.

Parameters
pointThe point to check.
rectThe rectangle to check against.
Returns
True if the point is within the rectangle; otherwise false.