本文整理汇总了C++中ogre::Entity::visitRenderables方法的典型用法代码示例。如果您正苦于以下问题:C++ Entity::visitRenderables方法的具体用法?C++ Entity::visitRenderables怎么用?C++ Entity::visitRenderables使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ogre::Entity
的用法示例。
在下文中一共展示了Entity::visitRenderables方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: visitor
Ogre::SceneNode *EMDOgre::createOgreSceneNodeModel(EMDModel *model, Ogre::SceneNode *parent, Ogre::SceneManager *scene_manager) {
Ogre::SceneNode *model_node = parent->createChildSceneNode();
vector<EMDMesh *> &meshes = model->getMeshes();
for (size_t i = 0; i < meshes.size(); i++) {
vector<EMDSubmesh *> &submeshes = meshes[i]->getSubmeshes();
if (!mesh_resources_created) {
createOgreEntityMeshes(meshes[i]);
}
for (size_t j = 0; j < submeshes.size(); j++) {
Ogre::Entity *entity = scene_manager->createEntity(meshes[i]->getName() + "_" + submeshes[j]->getMaterialName());
entity->setMaterialName(name + "_" + submeshes[j]->getMaterialName());
// Create Render Object Listeners depending on submesh definitions
vector<EMDSubmeshDefinition> definitions = submeshes[j]->getDefinitions();
EMBOgre *texture_pack = material_pack->getTexturePack();
EMBOgre *texture_dyt_pack = material_pack->getDYTTexturePack();
if (texture_pack && texture_dyt_pack) {
vector<Ogre::TexturePtr> textures = texture_pack->getOgreTextures();
vector<Ogre::TexturePtr> textures_dyt = texture_dyt_pack->getOgreTextures();
for (size_t k = 0; k < definitions.size(); k++) {
unsigned short texture_index = definitions[k].tex_index;
unsigned short dyt_texture_index = definitions[k].tex_index;
if (texture_index >= textures.size()) texture_index = textures.size()-1;
if (dyt_texture_index >= textures_dyt.size()) dyt_texture_index = textures_dyt.size() - 1;
EMDRenderObject *emd_render_object = new EMDRenderObject(textures[texture_index], textures_dyt[dyt_texture_index]);
EMDRenderObjectAssignVisitor visitor(emd_render_object);
entity->visitRenderables(&visitor);
created_render_objects.push_back(emd_render_object);
break; // FIXME: Figure out why there's multiple definitions
}
}
// Share Skeleton Instances with ESK's fake entity
if (skeleton) {
if (entity->hasSkeleton()) {
entity->shareSkeletonInstanceWith(skeleton->getEntity());
}
}
model_node->attachObject(entity);
}
}
return model_node;
}