I'm making a voxel engine, and I'm trying to figure out the right way to make efficient collisions with a slide response (making the player slide against the wall).
Currently my collisions are pretty simple : if, after update, the player bounding box collides with the voxel world, then we just cancel the collision.
I have seen this answer on SO, but I don't understand what the answerer means here. Since a voxel is a single unit, how can I compute its normal ? Should I map the 3x3x3 block surrounding the voxel to a precomputed normal ?
- Take the unit surface normal of the colliding voxel (pointing outward).