bool isCol(int aX, int aY,int aWidth,int aHeight, int bX, int bY, int bWidth, int bHeight){if ((aX+aWidth)< bX || aX > (bX+bWidth)) return false;if ((aY+aHeight)< bY || aY > (bY+bHeight)) return false;return true;}
rectangular collision
sorry the code didn''t post correct(it didn''t post parts of it)
All these rect collision functions look different even though they do the same thing so i post yet another one that does the same thing.
inline bool intersecting(const Rect& r1, const Rect& r2){ return (r1.left <= r2.right) && (r1.top <= r2.bottom) && (r1.right >= r2.left) && (r1.bottom >= r2.top);}
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement