本文整理汇总了C++中GraphicObject::createEntity方法的典型用法代码示例。如果您正苦于以下问题:C++ GraphicObject::createEntity方法的具体用法?C++ GraphicObject::createEntity怎么用?C++ GraphicObject::createEntity使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GraphicObject
的用法示例。
在下文中一共展示了GraphicObject::createEntity方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: activateDebugDraw
void RoutePlanner::activateDebugDraw(bool activate) {
if (activate) {
debugGraphicObject = GraphicEngine::getInstance()->createObject(getId());
std::list<RouteNode*> nodes = map.getItems();
for (std::list<RouteNode*>::iterator i = nodes.begin(); i != nodes.end(); i++) {
//Draw node
RouteNode* node = *i;
GraphicObject* object = debugGraphicObject->createChild(WasVec3d(node->position.x, 0, -node->position.y));
object->scale(WasVec3d(0.5, 0.5, 0.5));
Entity* entity = object->createEntity(PT_CUBE);
entity->setColor(ColourValue::BLUE);
//Draw paths
Vertex v1 = {node->position.x, 0, -node->position.y};
for (std::map<int, int>::iterator j = node->routeMap.begin(); j != node->routeMap.end(); j++) {
if (j->first == j->second) {
MeshPrototype prototype(WASABI_LINES);
Face face;
Vertex v2 = {getNode(j->first)->position.x, 0, - getNode(j->first)->position.y};
face.addVertex(v1);
face.addVertex(v2);
prototype.addFace(face);
Entity* entity = debugGraphicObject->createEntity(prototype);
entity->setColor(ColourValue::BLUE);
}
}
}
} else if (debugGraphicObject != NULL) {
GraphicEngine::getInstance()->destroyObject(debugGraphicObject);
}
debugDraw = activate;
}