It is currently Sat Aug 22, 2020 4:28 am


All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: PolyVox & Bullet physics
PostPosted: Tue Sep 10, 2013 5:46 pm 

Joined: Sun Mar 03, 2013 11:23 am
Posts: 4
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?


Top
Offline Profile  
Reply with quote  
 Post subject: Re: PolyVox & Bullet physics
PostPosted: Wed Sep 11, 2013 9:15 am 
Developer
User avatar

Joined: Sun May 04, 2008 6:35 pm
Posts: 1827
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.


Top
Offline Profile  
Reply with quote  
 Post subject: Re: PolyVox & Bullet physics
PostPosted: Wed Sep 11, 2013 1:50 pm 

Joined: Sun Mar 03, 2013 11:23 am
Posts: 4
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".


Top
Offline Profile  
Reply with quote  
 Post subject: Re: PolyVox & Bullet physics
PostPosted: Fri Sep 13, 2013 8:00 am 
Developer
User avatar

Joined: Sun May 04, 2008 6:35 pm
Posts: 1827
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?


Top
Offline Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Theme created StylerBB.net