Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 20 Oct 2012
Offline Last Active Nov 26 2012 03:20 AM

Topics I've Started

Area overlapping

05 November 2012 - 03:49 AM

Good day everyone, first poster long time follower here, i have a sorta conceptual question. I have already searched the forums and found nothing so here it is:
I have a 2D space identified by the typical X and Y axis on C++ float.
There are multiple "entities" modeled as Entity class instances(the class have all the methods needed to manage the entity).
The entity also have an "area" defined by some function(for now just circle and square) applied on the origin point of that entity, and they move.
Now, when entity A and B's area overlaps i need to execute the A.somemethod(B) and B.somemethod(A), the problem is: I can't think of any method to do that, at least somewhat efficiently, but i know it can be done, if someone can spare some advice, i'll be grateful :)