Functions
mk__mat4_pointfunction
mk_vec3 mk__mat4_point(const mk_mat4 *m, mk_vec3 p)
Transform a point by a column-major mk_mat4 (w=1, no perspective divide).
| Parameter | Type | Description |
|---|
m | const mk_mat4 * | Value for m. |
p | mk_vec3 | Value for p. |
Returns The resulting value.
mk__plane_distfunction
float mk__plane_dist(const mk_bplane *pl, mk_vec3 p)
Perform the plane dist operation.
| Parameter | Type | Description |
|---|
pl | const mk_bplane * | Value for pl. |
p | mk_vec3 | Value for p. |
Returns The resulting value.
mk__vmaxfunction
float mk__vmax(float a, float b)
Perform the vmax operation.
| Parameter | Type | Description |
|---|
a | float | Value for a. |
b | float | Value for b. |
Returns The resulting value.
mk__vminfunction
float mk__vmin(float a, float b)
Perform the vmin operation.
| Parameter | Type | Description |
|---|
a | float | Value for a. |
b | float | Value for b. |
Returns The resulting value.
mk_aabb_centerfunction
mk_vec3 mk_aabb_center(mk_aabb b)
Perform the aabb center operation.
| Parameter | Type | Description |
|---|
b | mk_aabb | Value for b. |
Returns The resulting value.
mk_aabb_contains_pointfunction
bool mk_aabb_contains_point(mk_aabb b, mk_vec3 p)
Perform the aabb contains point operation.
| Parameter | Type | Description |
|---|
b | mk_aabb | Value for b. |
p | mk_vec3 | Value for p. |
Returns True when the operation succeeds.
mk_aabb_extentsfunction
mk_vec3 mk_aabb_extents(mk_aabb b)
Perform the aabb extents operation.
| Parameter | Type | Description |
|---|
b | mk_aabb | Value for b. |
Returns The resulting value.
mk_aabb_from_center_extentsfunction
mk_aabb mk_aabb_from_center_extents(mk_vec3 center, mk_vec3 half)
Perform the aabb from center extents operation.
| Parameter | Type | Description |
|---|
center | mk_vec3 | Value for center. |
half | mk_vec3 | Value for half. |
Returns The resulting value.
mk_aabb_from_pointsfunction
mk_aabb mk_aabb_from_points(const mk_vec3 *pts, int count)
Perform the aabb from points operation.
| Parameter | Type | Description |
|---|
pts | const mk_vec3 * | Value for pts. |
count | int | Number of entries. |
Returns The resulting value.
mk_aabb_makefunction
mk_aabb mk_aabb_make(mk_vec3 min, mk_vec3 max)
Perform the aabb make operation.
| Parameter | Type | Description |
|---|
min | mk_vec3 | Value for min. |
max | mk_vec3 | Value for max. |
Returns The resulting value.
mk_aabb_mergefunction
mk_aabb mk_aabb_merge(mk_aabb a, mk_aabb b)
Perform the aabb merge operation.
| Parameter | Type | Description |
|---|
a | mk_aabb | Value for a. |
b | mk_aabb | Value for b. |
Returns The resulting value.
mk_aabb_overlaps_aabbfunction
bool mk_aabb_overlaps_aabb(mk_aabb a, mk_aabb b)
Perform the aabb overlaps aabb operation.
| Parameter | Type | Description |
|---|
a | mk_aabb | Value for a. |
b | mk_aabb | Value for b. |
Returns True when the operation succeeds.
mk_aabb_overlaps_spherefunction
bool mk_aabb_overlaps_sphere(mk_aabb b, mk_bsphere s)
Perform the aabb overlaps sphere operation.
| Parameter | Type | Description |
|---|
b | mk_aabb | Value for b. |
s | mk_bsphere | Value for s. |
Returns True when the operation succeeds.
mk_aabb mk_aabb_transform(mk_aabb b, const mk_mat4 *m)
Transform an AABB by a matrix and re-fit an axis-aligned box around it.
| Parameter | Type | Description |
|---|
b | mk_aabb | Value for b. |
m | const mk_mat4 * | Value for m. |
Returns The resulting value.
mk_frustum_contains_pointfunction
bool mk_frustum_contains_point(const mk_frustum *f, mk_vec3 p)
Perform the frustum contains point operation.
| Parameter | Type | Description |
|---|
f | const mk_frustum * | Value for f. |
p | mk_vec3 | Value for p. |
Returns True when the operation succeeds.
mk_frustum_from_vpfunction
mk_frustum mk_frustum_from_vp(const mk_mat4 *view_proj)
Extract the six frustum planes from a view-projection matrix (Gribb-Hartmann).
Normals point inward and are normalized; backend clip range handled internally.
| Parameter | Type | Description |
|---|
view_proj | const mk_mat4 * | Value for view proj. |
Returns The resulting value.
mk_frustum_test_aabbfunction
mk_containment mk_frustum_test_aabb(const mk_frustum *f, mk_aabb b)
Perform the frustum test aabb operation.
| Parameter | Type | Description |
|---|
f | const mk_frustum * | Value for f. |
b | mk_aabb | Value for b. |
Returns The resulting value.
mk_frustum_test_spherefunction
mk_containment mk_frustum_test_sphere(const mk_frustum *f, mk_bsphere s)
Perform the frustum test sphere operation.
| Parameter | Type | Description |
|---|
f | const mk_frustum * | Value for f. |
s | mk_bsphere | Value for s. |
Returns The resulting value.
mk_ray_from_screenfunction
mk_ray mk_ray_from_screen(float screen_x, float screen_y, const mk_camera *camera, const mk_vec4 *viewport)
Build a world-space picking ray from screen coordinates.
| Parameter | Type | Description |
|---|
screen_x | float | Value for screen x. |
screen_y | float | Value for screen y. |
camera | const mk_camera * | Value for camera. |
viewport | const mk_vec4 * | Value for viewport. |
Returns The resulting value.
mk_ray_hit_aabbfunction
bool mk_ray_hit_aabb(mk_ray r, mk_aabb b, float *out_t)
Ray vs AABB (slab method).
| Parameter | Type | Description |
|---|
r | mk_ray | Value for r. |
b | mk_aabb | Value for b. |
out_t | float * | Receives the t. |
Returns True when the operation succeeds.
mk_ray_hit_planefunction
bool mk_ray_hit_plane(mk_ray r, mk_bplane p, float *out_t)
Ray vs plane.
| Parameter | Type | Description |
|---|
r | mk_ray | Value for r. |
p | mk_bplane | Value for p. |
out_t | float * | Receives the t. |
Returns True when the operation succeeds.
mk_ray_hit_spherefunction
bool mk_ray_hit_sphere(mk_ray r, mk_bsphere s, float *out_t)
Ray vs sphere.
| Parameter | Type | Description |
|---|
r | mk_ray | Value for r. |
s | mk_bsphere | Value for s. |
out_t | float * | Receives the t. |
Returns True when the operation succeeds.
mk_ray_hit_trianglefunction
bool mk_ray_hit_triangle(mk_ray r, mk_vec3 a, mk_vec3 b, mk_vec3 c, float *out_t)
Ray vs triangle (Moller-Trumbore), two-sided.
| Parameter | Type | Description |
|---|
r | mk_ray | Value for r. |
a | mk_vec3 | Value for a. |
b | mk_vec3 | Value for b. |
c | mk_vec3 | Value for c. |
out_t | float * | Receives the t. |
Returns True when the operation succeeds.
mk_sphere_from_aabbfunction
mk_bsphere mk_sphere_from_aabb(mk_aabb b)
Perform the sphere from aabb operation.
| Parameter | Type | Description |
|---|
b | mk_aabb | Value for b. |
Returns The resulting value.
mk_sphere_overlaps_spherefunction
bool mk_sphere_overlaps_sphere(mk_bsphere a, mk_bsphere b)
Perform the sphere overlaps sphere operation.
| Parameter | Type | Description |
|---|
a | mk_bsphere | Value for a. |
b | mk_bsphere | Value for b. |
Returns True when the operation succeeds.