bool Drone::CollisionTest(SmartPtr<GameObject> o) { // if (o->GetType() != GameObjectType("Bullet")) return false; if (o->GetType() == GameObjectType("Drone")) return false; if (GetType() == o->GetType()) return false; if (mBoundingShape.GetPtr() == NULL) return false; if (o->GetBoundingShape().GetPtr() == NULL) return false; return mBoundingShape->CollisionTest(o->GetBoundingShape()); }
bool Asteroid::CollisionTest(SmartPtr<GameObject> o) { // Don't collide with objects of the same type if (GetType() == o->GetType()) return false; // If there's no bounding shape, don't do anything if (mBoundingShape.GetPtr() == NULL) return false; // If colliding object doesn't have a pointer to shape, don't do anything if (o->GetBoundingShape().GetPtr() == NULL) return false; // Otherwise, return the result of a collision test between bounding shapes return mBoundingShape->CollisionTest(o->GetBoundingShape()); }