/** * Checks if two collidables intersects with each other * */ bool CollisionBox::Intersects(const CollisionBox& other) { Vector3D<float>* otherPos = other.GetPosition(); Vector3D<float>& otherBounds = other.GetBounds(); if( _LeftCollision(otherPos, otherBounds) && _RightCollision(otherPos, otherBounds) && _TopCollision(otherPos, otherBounds) && _BottomCollision(otherPos, otherBounds) && _FrontCollision(otherPos, otherBounds) && _BackCollision(otherPos, otherBounds) ) { return true; } return false; }