本文整理汇总了C++中SmartPtr::GetBoundingShape方法的典型用法代码示例。如果您正苦于以下问题:C++ SmartPtr::GetBoundingShape方法的具体用法?C++ SmartPtr::GetBoundingShape怎么用?C++ SmartPtr::GetBoundingShape使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SmartPtr
的用法示例。
在下文中一共展示了SmartPtr::GetBoundingShape方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CollisionTest
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());
}
示例2: CollisionTest
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());
}