本文整理汇总了C++中ogre::SubMesh::isMatInitialised方法的典型用法代码示例。如果您正苦于以下问题:C++ SubMesh::isMatInitialised方法的具体用法?C++ SubMesh::isMatInitialised怎么用?C++ SubMesh::isMatInitialised使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ogre::SubMesh
的用法示例。
在下文中一共展示了SubMesh::isMatInitialised方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: update
void LIRenAttachmentEntity::update (float secs)
{
/* Check if background loading has finished. */
if (loaded)
return;
lisys_assert (entity == NULL);
/* Wait for the mesh to load. */
if (!mesh->isLoaded ())
{
if (loading_mesh)
return;
loading_mesh = true;
#ifdef LIREN_BACKGROUND_LOADING
Ogre::ResourceBackgroundQueue::getSingleton ().load (
"Mesh", mesh->getName (), mesh->getGroup ());
#else
mesh->load ();
#endif
return;
}
/* Start loading dependencies. */
if (!loading_deps)
{
loading_deps = true;
for (size_t i = 0 ; i < mesh->getNumSubMeshes () ; i++)
{
Ogre::SubMesh* sub = mesh->getSubMesh (i);
if (sub->isMatInitialised ())
{
Ogre::MaterialManager& mgr = Ogre::MaterialManager::getSingleton ();
Ogre::MaterialPtr material = mgr.getByName (sub->getMaterialName (), mesh->getGroup ());
if (!material.isNull ())
{
resources.push_back (material);
#ifdef LIREN_BACKGROUND_LOADING
Ogre::ResourceBackgroundQueue::getSingleton ().load (
"Material", material->getName (), material->getGroup ());
#else
material->load (true);
#endif
}
}
}
return;
}
// Wait for the dependencies to load.
for (size_t i = 0 ; i < resources.size () ; i++)
{
Ogre::ResourcePtr& resource = resources[i];
if (!resource->isLoaded ())
return;
}
// Create the entity.
Ogre::String e_name = render->id.next ();
entity = render->scene_manager->createEntity (e_name, mesh->getName (), LIREN_RESOURCES_TEMPORARY);
object->node->attachObject (entity);
// Create the skeleton and its pose buffer.
if (create_skeleton ())
{
LIRenModelData* model = get_model ();
lisys_assert (pose_buffer == NULL);
if (model != NULL)
{
pose_buffer = limdl_pose_buffer_new_copy (model->rest_pose_buffer);
lisys_assert (pose_buffer != NULL);
lisys_assert (pose_buffer->bones.count == entity->getSkeleton ()->getNumBones ());
}
}
// Set the entity flags.
entity->setCastShadows (object->get_shadow_casting ());
// Trigger queued texture replacements.
//
// This needs to be done before showing the entity in order to avoid
// the textures flickering for a few frames.
for (size_t i = 0 ; i < queued_texture_replaces.size () ; ++i)
{
LIRenTextureReplace& repl = queued_texture_replaces[i];
replace_texture_now (repl.name, repl.texture);
}
queued_texture_replaces.clear();
// Set entity visibility.
//
// If a visible entity is added to a hidden scene node, the entity is
// still rendered. Hence, newly added entities needs to be explicitly
// hidden or Ogre will render our invisible objects. */
entity->setVisible (object->get_visible ());
// Apply queued settings.
update_settings ();
// Clear the now useless dependency list.
resources.clear ();
//.........这里部分代码省略.........