World collision geometry should be loadable from a map's object layers #75

Open
opened 2026-08-02 18:38:32 -04:00 by tachikoma · 0 comments
Collaborator

Source: TODO.txt (at bbb7b8f)

World collision comes from the tile grid: akgl_collision_bind_tilemap
(examples/sidescroller/main.c:304) walks the map and builds static proxies out of
solid tiles. That covers a blocky platformer and is what the sidescroller uses.

It does not cover geometry a designer draws. Tiled object layers are where a
slope, a one-way platform, a trigger volume or a walkable region gets authored, and
akgl_TilemapObject already carries them into memory -- nothing turns them into
collision shapes.

The narrowphase and the broad phase are both in place, so this is a loader
question rather than a physics one: read the object layer, map each object's shape
to an akgl_CollisionShape, and insert it into the world as static geometry.

Connects to the deps/tg deadline. A concave region -- the walkable-area
case -- is exactly the query GJK and MPR structurally cannot answer and the one job
the vendored tg does well. If this lands as concave polygon support, tg gets the
consumer that keeps it in the tree; if it lands as convex-only, tg comes out.

Files: src/tilemap.c, src/collision.c, include/akgl/collision.h


Filed by Tachikoma (Claude Code, Opus 5, 1M context)

**Source:** TODO.txt (at bbb7b8f) World collision comes from the tile grid: `akgl_collision_bind_tilemap` (`examples/sidescroller/main.c:304`) walks the map and builds static proxies out of solid tiles. That covers a blocky platformer and is what the sidescroller uses. **It does not cover geometry a designer draws.** Tiled object layers are where a slope, a one-way platform, a trigger volume or a walkable region gets authored, and `akgl_TilemapObject` already carries them into memory -- nothing turns them into collision shapes. The narrowphase and the broad phase are both in place, so this is a loader question rather than a physics one: read the object layer, map each object's shape to an `akgl_CollisionShape`, and insert it into the world as static geometry. **Connects to the `deps/tg` deadline.** A *concave* region -- the walkable-area case -- is exactly the query GJK and MPR structurally cannot answer and the one job the vendored `tg` does well. If this lands as concave polygon support, `tg` gets the consumer that keeps it in the tree; if it lands as convex-only, `tg` comes out. **Files:** `src/tilemap.c`, `src/collision.c`, `include/akgl/collision.h` --- Filed by Tachikoma (Claude Code, Opus 5, 1M context)
tachikoma added this to the 1.0.0 milestone 2026-08-02 18:38:32 -04:00
tachikoma added the api-gapblast-radius:medium labels 2026-08-02 18:38:32 -04:00
tachikoma added the status::grooming label 2026-08-02 18:49:29 -04:00
Sign in to join this conversation.