Box2D Forums

It is currently Tue May 21, 2013 2:24 am

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: Sun Mar 02, 2008 9:22 am 
Offline

Joined: Sun Feb 17, 2008 7:18 am
Posts: 7
Box2D doesn't seem to make any attempt to 'push' blocks apart once they overlap. This means in my game players can often slowly 'push' through a solid (0 density) block. Once they are lodged in there, box2d seems to make no attempt to push them apart again, unless a force is applied to one of them. Is there any way I can make box2d push apart blocks which are overlapping?

Sorry this description is a bit vague. I can try to be more specific if necessary.


Top
 Profile  
 
PostPosted: Sun Mar 02, 2008 9:43 am 
Offline

Joined: Mon Dec 17, 2007 10:11 pm
Posts: 185
It should push them apart, what is your timestep and # of iterations?


Top
 Profile  
 
PostPosted: Sun Mar 02, 2008 10:53 am 
Offline

Joined: Sun Feb 17, 2008 7:18 am
Posts: 7
timestep 1/60, 15 iterations.

The best way to describe my simulation is the 'chain' demo, where I put impulses on the free end of the chain, and place stationay objects around. By jerking the end of the chain, it is possible to pull it through objects.


Top
 Profile  
 
PostPosted: Sun Mar 02, 2008 10:58 am 
Offline

Joined: Sun Feb 17, 2008 7:18 am
Posts: 7
After some fiddling, I seem to have made things much better my increasing the size of the blocks I make my rope out of, but still can abuse things if I try hard enough...


Top
 Profile  
 
PostPosted: Sun Mar 02, 2008 12:29 pm 
Offline
Site Admin

Joined: Thu Sep 06, 2007 12:34 am
Posts: 2931
Box2D allows some overlap by b2_linearSlop (defined in b2Settings.h).


Top
 Profile  
 
PostPosted: Sun Mar 02, 2008 12:46 pm 
Offline

Joined: Sun Feb 17, 2008 7:18 am
Posts: 7
Thanks very much for your advice!

I've changed by drawing code and can now see the problem, it is completely (well mostly) my own.

Basically, my problem can be characterized by pulling the rope over a thin block. The revolute joints aren't strong enough to keep the blocks together, so they stretch apart, and then some sneak down one side and some sneak down another. The way I was drawing the rope (by connecting the center points of each block) makes it look like the rope is going straight through the pillar, but in fact the different blocks are slipping down each side.

I'm now going to investigate different ways of doing ropes, probably involving much more overlap of the individual blocks.

Sorry for misleading people, I'll now experiment different ways of doing ropes!


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

All times are UTC - 8 hours [ DST ]


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