Collide balls and fuse
Posted: 10 February 2011 12:33 AM   [ Ignore ]
Avatar
Rank
Joined  2011-02-08
Total Posts:  71
New Member

Hey all,
I need to create an application using MT4J library in which two balls are acting under their own gravity and when they collide with each other, they fuse together in one ball such that radius of new one is less that the sum of radii of the two balls.

The problem I’m facing is how will I know when the two balls are colliding?
Please help!!

Profile
 
 
Posted: 10 February 2011 06:35 AM   [ Ignore ]   [ # 1 ]
Avatar
RankRankRankRank
Joined  2008-04-30
Total Posts:  612
Elite

Just check if the distance between both circle’s center points is smaller than the sum of both their radii.

EDIT:
btw, you may want to create your threads about MT4j in this Sub-Forum instead of the Procotols secion:
http://nuigroup.com/forums/viewforum/81/

 Signature 

MT4j - Multi-Touch for Java!

Profile
 
 
Posted: 10 February 2011 10:14 AM   [ Ignore ]   [ # 2 ]
Avatar
Rank
Joined  2011-02-08
Total Posts:  71
New Member

Thank you.
Will surely post my next thread in respective sections smile

Profile