Adding Physics into the Mix

Creating pretty voxel terrain (and managing it under the hood in the engine) was a good first step, but if we really want to push towards a prototype, we need to have entities roaming about the world. In order to do that, we need to have add physics – entities should be able to interact with the voxel terrain, and each other.

Adding a Physics Engine to the

There are a lot of off-the-shelf physics libraries, and there are a lot of good ones. But they are geared towards heavily detailed physics simulation (ragdoll physics, cloth physics, particle physics, etc), and make a lot of assumptions that lead to overheads. I want to a lightweight physics engine that integrates with a voxel world – and one that is simple enough to provide enough realism while not adding much overhead. The faster, the better – and the simpler, the faster.

The video above shows the work-in-progress where entities can collide with terrain, and each other. It uses the separating axis theorem as a basis for collision detection. I’m quite happy with it as a first cut, and its pretty close to what I want in the end. It’s crazy fast, which is important for what I want to do later.

Leave a comment

Your email address will not be published. Required fields are marked *