collisions optimization

BlitzMax Forums/BlitzMax Beginners Area/collisions optimization

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

step 2 shouldnt really need square root calculations. Instead of storing the radius of the bounding circle for each sprite you can store the radius squared.
That way when you want to see if the bounding circles have collided you simply calculate the distance between the two sprites and square it and compare the result with the sum of the stored 'raduis squared' of the sprites.

Did that make sense ?