Box2D Forums

It is currently Fri Nov 28, 2014 4:50 am

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Tue Dec 18, 2012 4:45 am 
Offline

Joined: Tue Dec 18, 2012 4:28 am
Posts: 2
Hi guys

I'm quite new to Box2dweb so still getting the hang of it all but theres 1 thing I can't quite figure out.

I'm creating a pool game, when the user has cueball in hand I allow them to drag it to wherever they want on the table. When this drag happens I set the object balls to static so that there are no collisions, however the cueball still tunnels into them - and if you let go of the mouse when this happens both the cueball and object ball move.

Is there anything I can do to stop this? Just a general nudge in the right direction would be much appreciated.

Thanks
Lee


Top
 Profile  
 
PostPosted: Wed Dec 19, 2012 10:25 am 
Offline

Joined: Tue Jun 24, 2008 8:25 pm
Posts: 1970
Location: Tokyo
The ball you are dragging is a dynamic body? Dragging it with a mouse joint?
As long as you destroy the joint before returning the other balls to dynamic I would expect it to be ok. Maybe you need to run the simulation for a few timesteps after releasing the dragged ball to make sure any slight penetration has been corrected.


Top
 Profile  
 
PostPosted: Thu Dec 20, 2012 1:24 am 
Offline

Joined: Tue Dec 18, 2012 4:28 am
Posts: 2
Hi

Yes the ball I'm dragging is dynamic and using a mouse joint, sorry I should have stated that in my previous post.

Thanks for your reply, it certainly lit a lightbulb and I've managed to get it working now! Thanks alot.

Lee


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 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