Best way to detect when all b2Body done colliding

General discussion about Box2D tutorials
Post Reply
kyle.bong2@gmail.com
Posts: 41
Joined: Thu May 29, 2014 5:01 am

Best way to detect when all b2Body done colliding

Post by kyle.bong2@gmail.com »

I am trying to figure what's the best way(standard) to detect when all box2d objects stop colliding. For example if I drop a box2d body onto a pile of body, how can i detect when all the collisions ended (or settled down)

I will take any ideas :)

Much Thanks!
iforce2d
Site Admin
Posts: 861
Joined: Sat Dec 22, 2012 7:20 pm

Re: Best way to detect when all b2Body done colliding

Post by iforce2d »

You mean when they stop moving right? That's not the same as 'stop colliding' because they will still be colliding with each other if they are piled up.
How about checking the linear velocity of them, and if it is less than a threshold value you could consider the pile to be settled.
kyle.bong2@gmail.com
Posts: 41
Joined: Thu May 29, 2014 5:01 am

Re: Best way to detect when all b2Body done colliding

Post by kyle.bong2@gmail.com »

Correct I meant settled. Thanks for the help! I will give it a try
Post Reply