Beginner: Getting going.

flight404 wrote:
Question 2: Just starting to use the ContactListener. Was wondering, is there a way to find out if a body is being touched by another body? So far, all I have managed is to get a list of contact points. Ideally, I would just be able to say something like if( body.isColliding ) or something similar.

No, currently there's no simple method to do this. I've thought of adding one, though, as I agree, it would be real nice to able to do simple contact
queries instead of manually saving away all the points for inspection later.

By the way, very cool videos! Anyone that hasn't seen them yet should check them out (first post in thread). Are you doing the Processing stuff within the PDE, or from Eclipse/Netbeans? If you're in Eclipse, I would suggest using the vm flags -server and -ea, which enable server mode and assertions, which will make things faster and also make them fail at the point where something first goes wrong; from the PDE, I don't think you can do that as easily.

pTymN wrote:
Dude, you need to change the broad phase overlap detection to use spatial hashing. You could acheive real time results. I know because I had a friend who was able to get 1500 fully 3d asteroids running in his game with a constant 100 fps framerate.

The broadphase usually isn't the bottleneck, it's either the island solving or graphics (if this is done in Processing, the bottleneck is almost certainly graphics), or sometimes callback handling. That said, if someone would like to hook up a spatial hash as a "drop in" for the broadphase, I'd be very interested to see the results...situations with huge numbers of swirling particles like this might be better served by a hash than sweep and prune, since everything is moving fast all the time, which is a bad case for SAP (lots of swaps).

Original thread: https://box2d.org/forum/viewtopic.php?t=1506