Jump to content
  • Advertisement
Sign in to follow this  
Marron

Unity Voxel game colliders.

This topic is 1665 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

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!

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!