Voxel game colliders.

Started by
2 comments, last by kalle_h 9 years, 10 months ago

Hello ! Can someone please explain how can colliders be implemented in a voxel game ? Or at least link to explanation, because I wasn't able to find it anywhere. I want to state that I am using OpenGL 3.3, so I can't just turn on 'mesh colliders' like in Unity. :)

Anticipated thanks.

Advertisement
You seem to be confusing graphics with physics.

The two are not directly interchangable.

Some game engines will use graphics meshes to build physics objects. Other games allow for many different types of physics objects; some use modeler-generated physics objects, some use 'footprints' that are laid down over a 2D navigation grid even though the world is a 3D mesh, some use rough bounding boxes rather than detailed meshes, some use combinations of these and more variations too.

It's going to be one hell of a work.

If you think voxel world, I think you're trying to do minecraft. An easy way to deal with collisions is the use of an external library. Bullet goes great with OpenGL since it uses the same coordinate system. Unfortunately, it's likely to run amok as you walk away from the center. Minecraft has an ad-hoc physics and still runs amok - after a few hours of walking from the origin I have been told.

Nonetheless, I strongly suggest to look at a physics library.

Due to the massive amounts of cubes in voxel worlds, you'll probably have to implement some very gross-grained block merge. While I've found cuboids to be fairly fast at both operation and add/remove operations, once you start having ten thousands objects, you'll be taxing the system a bit more than I'd like to and if your chunks are - say 30x30x30 you'll be blasting that big way!

Previously "Krohm"

It's going to be one hell of a work.

If you think voxel world, I think you're trying to do minecraft. An easy way to deal with collisions is the use of an external library. Bullet goes great with OpenGL since it uses the same coordinate system. Unfortunately, it's likely to run amok as you walk away from the center. Minecraft has an ad-hoc physics and still runs amok - after a few hours of walking from the origin I have been told.

Nonetheless, I strongly suggest to look at a physics library.

Due to the massive amounts of cubes in voxel worlds, you'll probably have to implement some very gross-grained block merge. While I've found cuboids to be fairly fast at both operation and add/remove operations, once you start having ten thousands objects, you'll be taxing the system a bit more than I'd like to and if your chunks are - say 30x30x30 you'll be blasting that big way!

Minecraft like world is rather poor fit with general physic engines if you can't explicitly tell to physic engine that whole world is built from static, uniform sized and spaced cubes. Basically it has acceleration structure built in and you need just 1 bit to store voxel and then you can do all physics in local space to battle against floating point errors.

But if you want complex physics then doing robust collions resolves with dynamic vs dynamic objects is going to be just as hard as always.

This topic is closed to new replies.

Advertisement