本文整理汇总了C++中PhysicsObject::GetOwner方法的典型用法代码示例。如果您正苦于以下问题:C++ PhysicsObject::GetOwner方法的具体用法?C++ PhysicsObject::GetOwner怎么用?C++ PhysicsObject::GetOwner使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PhysicsObject
的用法示例。
在下文中一共展示了PhysicsObject::GetOwner方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SweepAndPrune
/**
* @brief Helper method to enact sweep and prune broadphase method.
*/
void PhysicsWorld::SweepAndPrune()
{
PhysicsIT end = mObjects.end();
for(PhysicsIT it = mObjects.begin(); it != end; ++it)
{
PhysicsObject *itObject = *it;
if(!itObject->IsActive())
continue;
HashString itName = itObject->GetOwner()->GetName();
Transform *itTransform = itObject->GetOwner()->GET<Transform>();
for(PhysicsIT it2 = it; it2 != end; ++it2)
{
PhysicsObject *it2Object = *it2;
if(!it2Object->IsActive())
continue;
HashString it2Name = it2Object->GetOwner()->GetName();
bool ignore = itObject->IgnoreObject(it2Name) || it2Object->IgnoreObject(itName);
if(itObject != it2Object && !ignore)
{
if((!itObject->IsStatic() || !it2Object->IsStatic()) &&
!mResolver.Find(itObject, it2Object))
{
float x1 = itTransform->GetPosition().x;
float x1Size = itObject->GetBroadSize().x;
float x2 = it2Object->GetOwner()->GET<Transform>()->GetPosition().x;
float x2Size = it2Object->GetBroadSize().x;
float xPosDiff = fabs(x1 - x2);
float xSizeTotal = x1Size + x2Size;
if(xSizeTotal > xPosDiff)
{
mResolver.AddPrelimPair(PotentialPair(itObject, it2Object));
}
else
{
break;
}
}
}
}
}
}