本文整理汇总了C++中Pipeline::addCollidable方法的典型用法代码示例。如果您正苦于以下问题:C++ Pipeline::addCollidable方法的具体用法?C++ Pipeline::addCollidable怎么用?C++ Pipeline::addCollidable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Pipeline
的用法示例。
在下文中一共展示了Pipeline::addCollidable方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: tick
bool World::tick(float gameTime) {
bool playing = true;
this->gameTime = gameTime;
long gravityTick = trunc((gameTime * gameSpeed) / 128);
Pipeline pipeline = Pipeline(activeTet);
pipeline.addCollidable(this);
pipeline.addCollidable(heap);
pipeline.addTransformation(new Rotation(activeTet->getPivotPoint(), activeTet->getRotation()));
if (gravityTick > lastGravityUpdate) {
lastGravityUpdate = gravityTick;
pipeline.addTransformation(new Translation(gravityDirection));
}
pipeline.addTransformations(&inputTransforms);
inputTransforms.clear();
PipelineResult* result = pipeline.execute();
activeTet->setRotation(result->getNetRotation());
activeTet->setCoords(result->getNetOffset());
bool dead = result->isDead();
delete result;
if (dead) {
int rows = heap->addTet(activeTet);
switch (rows) {
case 1:
score += 50;
break;
case 2:
score += 100;
break;
case 3:
score += 200;
break;
case 4:
score += 500;
break;
default:
break;
}
if (!resetTet(nullptr)) {
playing = false || mode == INFINITY_MODE;
delete heap;
heap = new QuadHeap();
}
}
return playing;
}