本文整理汇总了C++中Body::getBody方法的典型用法代码示例。如果您正苦于以下问题:C++ Body::getBody方法的具体用法?C++ Body::getBody怎么用?C++ Body::getBody使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Body
的用法示例。
在下文中一共展示了Body::getBody方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: managedLevel
void Level::managedLevel()
{
//Level type initialization logic
switch(mLevelType)
{
case RUBE_BOX2D_LEVEL:{
rubeB2DLevel(mBox2dJson);
}
break;
default:break;
}
// Index the actors in the scene graph and in the set
for (Actor* actor : findChildren<Actor*>())
{
mActors[actor->getActorType()].insert(actor);
Body* aBody = actor->getBody();
if(aBody && aBody->manualInitialization()){
aBody->initBody();
#ifdef D_PARSE
Json::Value val = mBox2dJson.b2j(aBody->getBody());
qDebug() << "Manual Inited Body = " << QByteArray(val.toStyledString().c_str());
#endif
}
// For now, we define the teleporter to be an actor with the activationThreshold property.
QVariant variant = actor->property("activationThreshold");
if (variant.isValid()) {
if (mPortal) {
qDebug() << "Warning: Level has more than one teleporter.";
}
mPortal = actor;
}
}
}
示例2: DrawBodies
void Render::DrawBodies(list<Body*> bodies) {
list<Body*>::iterator bIter;
for (bIter = bodies.begin(); bIter != bodies.end(); ++bIter) {
Body* b = *bIter;
const b2Transform& xf = b->getBody()->GetTransform();
list<Fixture*> fixtures = b->getFixtureList();
list<Fixture*>::iterator fIter;
for (fIter = fixtures.begin(); fIter != fixtures.end(); ++fIter) {
Fixture* f = *fIter;
DrawShape(f->getFixture(), xf, f->getColor());
}
}
}