Box2D Forums

It is currently Tue May 21, 2013 7:23 am

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Fri Apr 20, 2012 3:35 pm 
Offline

Joined: Fri Apr 20, 2012 3:27 pm
Posts: 5
After experiencing some issues with bodies occasionally sticking to kinematic bodies in v2.1.2 I upgraded Box2D to v2.2.1

While I was glad to see that the issue had been fixed, when I loaded another level that features a large amount of bodies I noticed significant performance hit, halving the frame-rate. While the bodies are asleep they still seem to be draining on the CPU. Is there any way I could prevent this from happening?

Any advice would be greatly appreciated.

EDIT: Or it seems that bodies won't sleep when they are held by a Weld joint?


Top
 Profile  
 
PostPosted: Mon Apr 30, 2012 12:52 pm 
Offline
Site Admin

Joined: Thu Sep 06, 2007 12:34 am
Posts: 2931
You can use the debug draw to see what is awake. The CPU with everything sleeping should be low unless you have 10k+ bodies. After that you will start to see the expense of list traversal.

Also, make sure you don't have many bodies overlapped at a single location, leading to N*N collisions.


Top
 Profile  
 
PostPosted: Tue May 01, 2012 3:34 am 
Offline

Joined: Fri Apr 20, 2012 3:27 pm
Posts: 5
Thank for the reply, and great job on Box2D.
All of the bodies seem to be awake in debug draw. There doesn't seem to be any bodies overlapping. It just seems strange that the same scene is causing all of the bodies to be awake in 2.2.1 and not in 2.1.2. I'm going to try and exclude collisions between the bodies while they're connected to see if that helps but I thought I should let you know.


Top
 Profile  
 
PostPosted: Tue May 01, 2012 9:43 am 
Offline
Site Admin

Joined: Thu Sep 06, 2007 12:34 am
Posts: 2931
The ApplyForce type of functions might be waking the bodies.


Top
 Profile  
 
PostPosted: Tue May 01, 2012 10:28 am 
Offline

Joined: Fri Apr 20, 2012 3:27 pm
Posts: 5
I've checked and there's no force being applied to the bodies. I think that 2.2.1 counts bodies as colliding when they are close to each other. Thanks for the help :)


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

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


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