Expose Box3D collision profiles through Ymir

This commit is contained in:
Meta Vens 2026-07-14 22:01:19 +01:00
commit e49fe42ef9
21 changed files with 540 additions and 51 deletions

View file

@ -145,10 +145,11 @@ The native facade must remain boring:
## Persistence
`gamecult.ymir.world_state.v1` appends planar direction and angular velocity to
the v0 layout. The v0 reader is an explicit migration path; keys are not
reassigned. Torque is transient command state and is intentionally absent.
Version 1 is a compatibility world snapshot, not a complete retained-session
`gamecult.ymir.world_state.v2` appends Box3D body type, bullet,
field-participation, and collision filter arrays to the v1 layout. The v1 and
v0 readers are explicit migration paths; keys are not reassigned. Torque is
transient command state and is intentionally absent. Version 2 is a
compatibility world snapshot, not a complete retained-session
checkpoint: it does not preserve full shape, material, filter, session tuning,
provenance, or warm contact state.
@ -172,7 +173,7 @@ Box3D-backed sessions prove:
1. fixed-step body state projection;
2. begin/end/hit contact lifecycle;
3. overlap and shape-cast lowering;
4. continuous collision and projectile witnesses;
4. continuous collision event timing and same-step Box3D cast witnesses;
5. transient force and torque application;
6. checkpoint reconstruction and replay;
7. Aetheria gravity, tractor, pickup, and payload smokes.

View file

@ -21,7 +21,7 @@ the overlap, cast, pair-step, torque-lifetime, version, and ABI-layout
operations used by the harness. This keeps Box3D's alpha C ABI out of Ymir's
public managed contracts.
Production ABI version 3 uses caller-owned blittable buffers, explicit cdecl,
Production ABI version 4 uses caller-owned blittable buffers, explicit cdecl,
fixed-width status/count values, compile-time C layout assertions, and a
managed/native layout sentinel before opening a session. It adds explicit
retained body mutations, one-shot force and torque operations, and a
@ -30,6 +30,8 @@ stored contact key only long enough to correlate its separate event arrays;
public Ymir facts never expose native contact identity. Planar direction maps to Box3D
rotation about Y; angular velocity and transient torque remain Box3D state and
commands rather than managed integration.
ABI v4 additionally carries Box3D static/kinematic/dynamic selection, bullet
CCD, category/mask/group filtering, and per-body radial-field participation.
`tests/Ymir.Box3D.Parity` builds that facade through CMake and invokes it with
source-generated .NET interop. Run it with:
@ -58,6 +60,12 @@ is retained in the pinned submodule.
- Restitution uses the maximum of the two shape materials.
- Applied torque is transient and cleared by each world step; a continuous
torque must be submitted again for the next step.
- A negative Box3D group index suppresses collision within that group before
category/mask evaluation. Category and mask bits then decide eligible pairs.
- Bullet CCD against a kinematic target prevents traversal during the fast
step, but Box3D v0.1.0 emits the typed contact event on the following step.
Same-step gameplay triggering therefore requires an explicit Box3D shape
cast; Ymir must not invent an earlier Begin event.
## Cut Line

View file

@ -38,7 +38,7 @@ The retained port accepts narrow operations with explicit meaning:
- remove a body, rejecting an unknown id;
- teleport a body;
- set linear and angular velocity;
- configure body shape, mass, type, and restitution;
- configure body shape, mass, static/kinematic/dynamic type, and restitution;
- apply one-shot force or torque;
- step with a fixed delta, substep count, and typed fields;
- dispose the session.
@ -46,6 +46,10 @@ The retained port accepts narrow operations with explicit meaning:
The current public slice implements those mutation and step operations.
Retained-world overlap and cast queries at a named revision are the next
library cut; the static compatibility queries do not satisfy that contract.
Bullet, collision-filter, and field-participation profiles are currently
spawn/restore definitions. Retained `Configure` changes radius, mass,
static/kinematic/dynamic type, and restitution only. Changing the profile
requires explicit remove-and-spawn until a typed profile command exists.
Restore/import is the only path allowed to accept a complete world snapshot.
There is no `Upsert`, generic patch bag, or omission-based removal.
@ -73,7 +77,7 @@ chronology.
- Box3D handles are process-local and never cross the contract.
- DTO and SoA body arrays are projections.
- `gamecult.ymir.world_state.v1` is an inspection/migration snapshot, not a
- `gamecult.ymir.world_state.v2` is an inspection/migration snapshot, not a
retained-session checkpoint.
- Receipt and contact-episode ledgers are session metadata, not physics law.
- Aetheria cargo, damage, loot, feedback, and scoring remain gameplay state