Physics Simulation Forum

 

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Giant static forest
PostPosted: Sun Apr 01, 2012 4:00 pm 
Offline

Joined: Sun Jan 29, 2012 10:01 pm
Posts: 49
I have a giant forest with trees to collide with but just adding them as static rigid bodies gives poor performance because they are in the same broad phase as dynamic bodies.
Can I modify the height field class to return cones and other shapes from each tile in a low resolution grid?
If not, I could let the modified height field point to triangle shapes to transform per vertex but taking any shape would be more reusable.


Top
 Profile  
 
 Post subject: Re: Giant static forest
PostPosted: Wed Apr 04, 2012 12:38 pm 
Offline

Joined: Fri Dec 10, 2010 3:39 am
Posts: 15
wait, so are they all trimeshes right now?


Top
 Profile  
 
 Post subject: Re: Giant static forest
PostPosted: Wed Apr 04, 2012 1:17 pm 
Offline

Joined: Sun Jan 29, 2012 10:01 pm
Posts: 49
They are cone shapes with hand written dimensions right now. I have a list of triangles in the graphical model that I can read directly inside a collision shape but a cone shape would avoid multiplying each vertex with a transformation matrix each time they are used for collision.

My idea is to look up all shapes in the cells that overlap the query AABB and return all shapes who's AABB intersect with the dynamic body's AABB. The Query AABB is the dynamic body's world space AABB + tolerance for how much the static bodies are outside of their cells in the grid.


Top
 Profile  
 
 Post subject: Re: Giant static forest
PostPosted: Sun Apr 22, 2012 11:48 am 
Offline

Joined: Sun Jan 29, 2012 10:01 pm
Posts: 49
Now when I have my debug drawing working, I see that the reason for the bad performance is invalid calculation of world space bounding boxes. Every tree's bounding box is stretched to the center of the world so that the tree for static bodies do nothing for the speed. I don't use compound shapes for the cones and I place them at their initial locations before adding them to the world.

Edit:
Calling setInterpolationWorldTransform after calling setWorldTransform with the same transformation when placing static bodies solved the bug. :)


Top
 Profile  
 
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 13 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:  
Powered by phpBB® Forum Software © phpBB Group