A simple first-person shooter engine written in ~1200 lines of Zig, featuring brush-based geometry and BVH accelerated swept point-based collision detection with source-like movement including surfing.
- First-person movement with mouse look and WASD controls
- Brush-based geometry using convex polyhedra for collision and rendering
- BVH spatial acceleration for efficient collision queries
- Quake-style physics with proper acceleration, friction, and air control
- Cross-platform graphics via Sokol (OpenGL, Metal, WebGL, WGSL)
- Audio system with background music and sound effects
- WASD - Move
- Mouse - Look around
- Space - Jump
- Escape - Toggle mouse lock
- Zig (latest)
zig build runzig build -Dtarget=wasm32-emscripten- Physics - Collision detection with brush expansion and BVH traversal
- Rendering - Mesh generation from brush plane intersections
- Audio - 16-voice mixer with PCM file support
- Math - SIMD-optimized Vec3/Mat4 operations
The world consists of 8 brushes defining platforms, slopes, and structures. Each brush is a convex polyhedron represented by plane equations, enabling both collision detection and mesh generation from the same data.