Physics Simulation Forum

 

All times are UTC




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: Tue Jul 22, 2008 10:57 pm 
Offline

Joined: Fri Oct 12, 2007 6:28 pm
Posts: 66
Location: San Diego
My game has around 1200 static collision object in it, and no dynamic objects (we currently use only ray and convex sweep tests). It's just the static world (ground, rocks, trees, etc.).

If I call performDiscreteCollisionDetection() while using btDbvtBroadphase, it consumes between 2 and 3 ms. This seems rather high considering all of my objects are static and I have the Filters and Masks set so they don't collide with eachother.

Is there something I am missing?


Top
 Profile  
 
PostPosted: Wed Jul 23, 2008 12:53 am 
Offline

Joined: Mon Nov 13, 2006 1:44 am
Posts: 78
Can you provide a reproduction case ?

Thanks for the feedback,
Nathanael.


Top
 Profile  
 
PostPosted: Wed Jul 23, 2008 1:14 am 
Offline

Joined: Fri Oct 12, 2007 6:28 pm
Posts: 66
Location: San Diego
Not easily. This is a commercial project.

It's an area with ground broken up into tiles, and a bunch of objects sitting on the ground (rocks, trees, houses, etc.)

I'm using just btCollisionWorld (no dynamics).
The total count of collision objects in the system is around 1200.
They are all flagged as static (the filters/masks setup as Erwin suggested in an other thread).
There should be no collision pairs at all.

I was mainly just asking if there is something I missed in setting up btDbvtBroadphase. Perhaps something related to static objects?


Top
 Profile  
 
PostPosted: Wed Jul 23, 2008 2:21 am 
Offline

Joined: Mon Nov 13, 2006 1:44 am
Posts: 78
Ok, here's a quick work around, if after your objects creation you call myrigidbody->setActivationState(ISLAND_SLEEPING); that should fix the issue.

In the upcoming version (2.70), btDbvtBroadphase is optimized for your use case, and add the following method: bDbvttBroadphase::optimize() to be called after world creation to ensure fast queries right away (and not over time like now).

I attached (
Attachment:
btDbvtBroadphase2.70.zip [4.62 KiB]
Downloaded 45 times
) an uncommitted version of btDbvtBroadphase if you cannot wait for 2.70, but make sure you build against the latest svn version.
If you can't, give me the svn version you build against, and I'll try to give you a quick patch.

In CDTestframework, btDbvtBroaphase do ~0.3 ms for 8192 static objects, versus ~2ms for btAxisSweep3 (SAP), so btDbvtBroadphase should actually be faster than SAP in your case.

Hope it help,
Nathanael.


Top
 Profile  
 
PostPosted: Wed Jul 23, 2008 6:57 pm 
Offline

Joined: Fri Oct 12, 2007 6:28 pm
Posts: 66
Location: San Diego
Okay!

I first tried just using your updated files with no changes to my code and it didn't have any effect, it was still 2-3ms per frame (I did wait quite a while after starting to allow for settling if any).

However, when I added a call to btCollisionObject->setActivationState(ISLAND_SLEEPING) it worked. The timing was down to 0.1 to 0.2 ms per frame.

Just to clarify, I am not using btDynamicsWorld at all, and don't have rigidbody objects. I am just using btCollisionWorld with btCollisionObjects. Perhaps the activation state is not updated in this case?

Thank you for your help,
Roy Eltham
Senior Programmer
SOE Free Realms


Top
 Profile  
 
PostPosted: Thu Jul 24, 2008 2:47 am 
Offline

Joined: Mon Nov 13, 2006 1:44 am
Posts: 78
Humm, if you have time, can you post timings of btDbvtBroadphase and btSweepAxis ? and if possible a more detailed profiling output, i'd like to get to the bottom of this.
Did you called btDbvtBroadphase optimize after your static world creation?

Nathanael.

btw, FreeRealms like very nice.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 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