Expand description
Collision query layer (stage CC) — box-vs-voxel overlap over a
scene; see docs/porting/PORTING-CONTROLLER.md.
Collision query layer (stage CC.0 — see
docs/porting/PORTING-CONTROLLER.md).
World-space box-vs-voxel overlap tests over a whole Scene,
promoted from the three demo copies of the fly-camera collision
hack (scene-demo collision.rs, cave-demo, cave-web) so the CC
character controller — and the demos themselves — share one
implementation with the demos’ hard-won lessons pinned as unit
tests here:
- Solidity comes from
roxlap_core::world_query::getcube:Cube::ColorandCube::UnexposedSolidblock (slab interiors are solid material),Cube::Airdoes not. - The voxlap bedrock placeholder at chunk-local
z = CHUNK_SIZE_Z - 1is a policy, not a fact —Solidity::bedrock_blocks, defaultfalseto match the demos’treat_z_max_as_airrendering (else an invisible wall appears at every grid’s bottom plane). - Positions outside every grid’s footprint are air, so a body can move past a grid without hitting invisible bounds.
Grid placement: axis-aligned grids are probed cell-exactly (the box’s floor-range of voxel cells); rotated grids are probed conservatively — the world box’s 8 corners are transformed into grid-local space and their local AABB is probed, which blocks slightly early near rotated geometry but never leaks. An exact OBB-vs-voxel test is out of scope for a controller-grade query.
Structs§
- Solidity
- What counts as solid for a collision probe.
Functions§
- box_
overlaps_ solid trueif the axis-aligned world-space box[min, max]overlaps any solid voxel of any grid inscene.- grid_
box_ overlaps_ solid - Single-grid form of
box_overlaps_solid— the building block the scene-level test folds over, public for hosts that manage their own grid (the cave demos collide against one grid only). - point_
overlaps_ solid - Point form of
box_overlaps_solid:trueif the voxel cell containing the world-space pointpis solid in any grid.