本文整理汇总了C++中Collision::contains方法的典型用法代码示例。如果您正苦于以下问题:C++ Collision::contains方法的具体用法?C++ Collision::contains怎么用?C++ Collision::contains使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Collision
的用法示例。
在下文中一共展示了Collision::contains方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: update
//.........这里部分代码省略.........
pp = co1->getPhysicalProperties();
//pp->setVelocity(pp->getVelocityX()*9.99f,pp->getVelocityY()*9.99f);
pp = co2->getPhysicalProperties();
//pp->setVelocity(pp->getVelocityX()*9.99f,pp->getVelocityY()*9.99f);
pp = player->getPhysicalProperties();
pp->setPosition(pp->getX() + (pp->getVelocityX()*(colTime-timer)),pp->getY() + (pp->getVelocityY()*(colTime-timer)));
botIterator = sm->getBotsIterator();
while (botIterator != sm->getEndOfBotsIterator())
{
Bot *bot = (*botIterator);
pp = bot->getPhysicalProperties();
pp->setPosition(pp->getX() + (pp->getVelocityX()*(colTime-timer)), pp->getY() + (pp->getVelocityY()*(colTime-timer)));
botIterator++;
}
gsm->updateViewport(game, colTime-timer);
resolveCollision(game, currentCollision);
gR->gameSpecificResolve(game, currentCollision);
boolean deleteLast = false;
list<Collision*>::iterator cIterator = collisions.begin();
list<Collision*>::iterator lastIterator;
while(cIterator != collisions.end())
{
if(deleteLast == true)
{
collisions.erase(lastIterator);
}
deleteLast = false;
Collision* check = (*cIterator);
if(check->contains(co1) || check->contains(co2))
{
CollidableObject* checkStatic = check->getCO2();
if(checkStatic->isStaticObject())
{
coStackCounter ++;
coStack[coStackCounter] = checkStatic;
}
collisionStackCounter ++;
collisionStack[collisionStackCounter] = check;
lastIterator = cIterator;
deleteLast = true;
}
else
{
//check->calculateTimes();
}
cIterator++;
}
if(deleteLast == true)
{
collisions.erase(lastIterator);
}
collideTestWithTiles(co1, tL, &collisions);
collideTestWithSprites(game, co1, &collisions);
if(co2->isStaticObject() == false)
{