Volumes Of Fun
http://www.volumesoffun.com/phpBB3/

PolyVox & Bullet physics
http://www.volumesoffun.com/phpBB3/viewtopic.php?f=14&t=537
Page 1 of 1

Author:  Neirdan [ Tue Sep 10, 2013 5:46 pm ]
Post subject:  PolyVox & Bullet physics

Hello there.

I wrote a post about a year ago about wtfbbq can't compile polyvox, but I learned a bunch of stuff in between so basically I was just a retarded noob.

Now I have a question about something I'm working in that requires a tremendous amount of physics for collision, so I am using bullet physics for it's high reliability.
There are 2 ways to create a RigidBody of a voxel chunk (mines are 100x100x3):

-Create a compound shape and add each small cube independently
-Export the generated mesh (vertices + indices) and feed it to a meshbuffer so bullet generates a shape

From your experience, what is the best solution?

Author:  David Williams [ Wed Sep 11, 2013 9:15 am ]
Post subject:  Re: PolyVox & Bullet physics

Neirdan wrote:
-Export the generated mesh (vertices + indices) and feed it to a meshbuffer so bullet generates a shape


This is what we are doing in Cubiquity and it works pretty well. That said, there are two more options which it would be interesting to investigate:

- Create a 'surface extractor' which generates a list of cubes instead of a index/vertex buffer. These cubes should be combined into larger cuboids where possible. Similar to you first suggestion, except it would be done inside PolyVox rather than combining in Bullet. This code was posted to the forums and could be a starting point.

- Extend Bullet with a volume primitive in addition to its existing heightmap primitive. No idea how to do this, but in principle it could bypass the mesh completly and just do the collision checks against the volume data.

Author:  Neirdan [ Wed Sep 11, 2013 1:50 pm ]
Post subject:  Re: PolyVox & Bullet physics

Yeah my problem right now is that I have an impressive number of triangles and I tried the depreciated mesh decimator which gave an awful result.

I have to display up to 25*100*100 which makes approximately 1.250.000 triangles. I'm not using the voxel engine "conventionally".

Author:  David Williams [ Fri Sep 13, 2013 8:00 am ]
Post subject:  Re: PolyVox & Bullet physics

I don't think that number of triangles should be a problem, as long as you don't put them all into once single collision mesh. Break your volume down into regions and generate a separate mesh for each. One of our old tech demos used a 256x256x64 volume in this way, and it ran quite fast. You can see the video here: https://www.youtube.com/watch?v=5XTJABlV9zw

I don't remember how big our regions were - I guess 16x16x16 or 32x32x32?

Page 1 of 1 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/