/* * ============================================================ * FILE: world.h * * PURPOSE: Public interface for "the level". Today the level is a blank, * flat square of ground, and this API is how other modules ask * questions about it. * * FITS IN: physics.c asks for the ground height and bounds. main.c asks * for the spawn point. render.c asks for the extent so it knows * how big a grid to draw. * * INTERFACE: Use these exact signatures: * * void world_init(void); * float world_ground_height(float x, float z); * Height of the ground at (x, z). Returns 0.0f for now. This is * the one hook where terrain/platforms will plug in later. * Vec3 world_clamp_to_bounds(Vec3 p); * Returns p with x and z clamped to [-WORLD_HALF_EXTENT, * +WORLD_HALF_EXTENT]. y is untouched. * Vec3 world_spawn_point(void); * Where the player starts / resets to: (0, 0, 0) for now. * float world_half_extent(void); * Returns WORLD_HALF_EXTENT (so render.c doesn't need config * knowledge of the world's shape). * * Include "math3d.h". * * CONVENTIONS: Include guard: WORLD_H. * * NOT IN SCOPE: Level files, platforms, walls, slopes, objects. * * DONE WHEN: physics.c and render.c can be written using only this header. * ============================================================ */ #ifndef WORLD_H #define WORLD_H #endif /* WORLD_H */