本文整理汇总了C++中Obstacle::setDefaultZ方法的典型用法代码示例。如果您正苦于以下问题:C++ Obstacle::setDefaultZ方法的具体用法?C++ Obstacle::setDefaultZ怎么用?C++ Obstacle::setDefaultZ使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Obstacle
的用法示例。
在下文中一共展示了Obstacle::setDefaultZ方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: pushObject
//--------------------------------------------------------------
void Scenario::pushObject(ofxBulletWorldRigid &world, int typeObject, ofVec3f pos){
// ScenarioObjects.push_back(&m_obstable1);
/*
ofVec3f pos;
pos.x = ScenarioXml.getValue("positionX",0.0, 0);
pos.y = ScenarioXml.getValue("positionY",0.0, 0);
pos.z = ScenarioXml.getValue("positionZ",0.0, 0);
*/
switch(typeObject){
case SimpleObject::ShapeTypeBall:{
Ball *oBall = new Ball(currentMissions);
oBall->setup(world, pos);
oBall->setDefaultZ();
ScenarioObjects.push_back(oBall);
}
break;
case SimpleObject::ShapeTypeHammer:{
Hammer *oHammer = new Hammer(currentMissions);
oHammer->setup(world, pos);
oHammer->setDefaultZ();
ScenarioObjects.push_back(oHammer);
}
break;
case SimpleObject::ShapeTypeLever:{
Lever *oLever = new Lever(currentMissions);
int dir = 0;
oLever->setup(world, pos, "cylinder.stl", ofVec3f(0.05, 0.05, 0.05), dir);
oLever->setDefaultZ();
ScenarioObjects.push_back(oLever);
}
break;
case SimpleObject::ShapeTypeObstacle:{
Obstacle *oObstable = new Obstacle(currentMissions);
oObstable->setup(world, pos, "cylinder.stl", ofVec3f(0.05, 0.05, 0.05));
oObstable->setDefaultZ();
ScenarioObjects.push_back(oObstable);
}
break;
}
}