code wiki / (root) / nx_collision_aabb.nx

nx_collision_aabb.nx

buildroot/runtime/nx_collision_aabb.nx

5333 B153 linesdepth 3pulls 3 transitivereach 2 importersview sourcekind librarytopic collision
docsdependenciesstructsconstsfunctions

about

nx_collision_aabb.nx -- axis-aligned bounding box collision (Q14). Fixed-point collision primitive. Used by game-engine for: - player vs voxel (post-raycast solid-block resolution) - player vs entity (NPCs, items, projectiles) - ray vs AABB (efficient broad-phase) Q14 throughout — no float. Composes with nx_q14_math + nx_raycast_voxel.

dependencies 3 imports · 2 importers

nx_syscalls.nx nx_tier.nx nx_q14_math.nx nx_collision_aabb.nx nx_collision_aabb_test.nx nx_game_runtime_compose_test.nx

imports: nx_syscalls.nxnx_tier.nxnx_q14_math.nx

imported by: nx_collision_aabb_test.nxnx_game_runtime_compose_test.nx

structs

22struct NxAabb

consts

13const NX_MAGIC_2147483647: i64 = 2147483647
15const NX_AABB_NO_OVERLAP: nx_int = 0
16const NX_AABB_OVERLAP: nx_int = 1

functions

31func nx_aabb_new(min_x: nx_int, min_y: nx_int, min_z: nx_int,
called by 3: nx_aabb_from_voxelmainmain calls 1: sys_mmap
43func nx_aabb_from_voxel(vx: nx_int, vy: nx_int, vz: nx_int) -> *NxAabb
called by 2: mainmain calls 1: nx_aabb_new
53func nx_aabb_overlap(a: *NxAabb, b: *NxAabb) -> nx_int
called by 2: mainmain
65func nx_aabb_contains_point(b: *NxAabb,
called by 1: main
80func nx_aabb_translate(b: *NxAabb, dx_q14: nx_int, dy_q14: nx_int, dz_q14: nx_int) -> nx_int
called by 2: mainmain
96func nx_aabb_intersect_ray(b: *NxAabb,
called by 2: mainmain