Box2D Forums

It is currently Fri May 24, 2013 6:50 pm

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Tue Mar 15, 2011 5:06 am 
Offline

Joined: Tue Mar 15, 2011 4:12 am
Posts: 5
G'day!

Firstly, let me thank 'MayoButter' (Jesse Sternberg) for his selfless efforts and community helping/sharing spirit.
Thanks to Mr. Erin Catto, too.

I am still a n00b at WCK and my knowledge of physics is pretty limited.

Alright, let me now move on to a problem that I am facing with collisions.

1) Supposing I draw a 'box' on the screen and let it drop on a stationary 'box' lying on the ground, sometimes the falling box just goes 'inside' the stationary box and then bounces back. Instead of bouncing at the very first touch (with the stationary box) it does at times bounces a wee bit late after it has gone inside of the stationary box. I am not sure if I am doing something wrong.

2) Also, sometimes, if the box that is drawn on the screen is really small or thin, and if it falls on a box that is rotating on a 'joint' positioned at the center of the box, the falling box doesn't register any contact whatsoever with the rotating box (this does happen intermittently though)

I have managed to get a printscreen of both the problems and have attached it with this post. I haven't modified anything in these pictures except adding the text.


Thank you,
Macoy


Attachments:
File comment: 2nd issue printscreen
intersect collide joint.png
intersect collide joint.png [ 23.08 KiB | Viewed 677 times ]
File comment: 1st issue printscreen
intersect collide.png
intersect collide.png [ 41.46 KiB | Viewed 677 times ]
Top
 Profile  
 
PostPosted: Tue Mar 15, 2011 6:55 am 
Offline

Joined: Mon Apr 26, 2010 5:35 am
Posts: 20
Hi i might be able to help with this one. The box2d physics are calculated per timestep, so for example i have drawn a diagram, the top circle shows what happens with low iterations, the bottom circle what would happen with high iterations (using isbullet for example).

Image

Play about with positioniterations, velocityiterations and the timestep, adjusting the scale could also help too if your only using small shapes. You can find these in the components inspector on a world instance.


Top
 Profile  
 
PostPosted: Tue Mar 15, 2011 1:17 pm 
Offline

Joined: Tue Nov 09, 2010 1:26 am
Posts: 92
Put the following,

Code:
bullet = true;


on your critical objects. I'm sure there's a higher cost for this sort of prioritization, so it's best to figure out which objects you should put this on (maybe just your spinning objects instead of on each of 40 balls that could be hitting those 4 or 5 spinning objects).


Top
 Profile  
 
PostPosted: Tue Mar 15, 2011 11:40 pm 
Offline

Joined: Tue Mar 15, 2011 4:12 am
Posts: 5
@engiebenjy:
Thank you Sir, for your reply. :)

I did try to mess around with those 4 odd inspectable variables but I couldn't seem to find the right balance. It did seem like it worked okay to an extent but after doing a more thorough testing, those issues still lingered.

@burtonposey:
putting 'bullet = true' worked like a charm! :D
Thank you.


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

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: Exabot [Bot] 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:
Powered by phpBB® Forum Software © phpBB Group