diff options
Diffstat (limited to '')
| -rw-r--r-- | platformer/src/world.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/platformer/src/world.h b/platformer/src/world.h index 4cfcf71..422be28 100644 --- a/platformer/src/world.h +++ b/platformer/src/world.h @@ -3,8 +3,10 @@ * FILE: world.h * * PURPOSE: Public interface for "the level" while the game runs: a flat - * square of ground with box-shaped platforms and terrain on it - * (some of them moving). This API is how other modules ask + * square of ground with OBJECTS on it (solid boxes: platforms, + * terrain, walls; some of them moving) and ZONES (non-solid + * regions that change behavior inside them, even when box-shaped). + * "Box" here means an object unless it's a zone's bounds. This API is how other modules ask * questions about the level's geometry. * What's IN the level is decided by level.c (level.h). * @@ -68,6 +70,10 @@ * Vec3 world_spawn_point(void); * Where the player starts / resets to (level_spawn_point()). The * area around it is kept clear of platforms. + * bool world_object_at(Vec3 point, float radius, Box *hit); + * True (and *hit = that object) if the point is within `radius` of + * the inside of an OBJECT (zones never count). The camera uses it + * to keep the eye out of objects. * int world_zone_count(void); * Zone world_zone(int i); 0 <= i < world_zone_count() (render.c draws them) * bool world_in_zone(Vec3 point, ZoneKind kind); @@ -131,6 +137,7 @@ float world_ceiling_above(Vec3 head, float half_width); bool world_find_overlap(Vec3 feet, float half_width, float height, Box *hit); Vec3 world_clamp_to_bounds(Vec3 p); Vec3 world_spawn_point(void); +bool world_object_at(Vec3 point, float radius, Box *hit); int world_zone_count(void); Zone world_zone(int i); bool world_in_zone(Vec3 point, ZoneKind kind); |
