• Welcome to Dark Bit Factory & Gravity.
 
Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - gerarmajax

#1
Thanks.
Checking the min/max is also very efficient. Then it depends how the data are stored. In a test I did a while ago, I checked the collision between squares of changing size. Storing the center position and the (half)side was more practical.
#2
in your case you can easily forget the 3rd dimension and do all your tests in 2D ;)
Also when the squares are all axis-aligned, the math are ridiculously simple. You end up checking that the absolute of the distance ( respectively in X and Y ) between the unit and the building is > half the side of the unit + half the side of the building