本文整理汇总了C++中ogre::SubEntity::setCustomParameter方法的典型用法代码示例。如果您正苦于以下问题:C++ SubEntity::setCustomParameter方法的具体用法?C++ SubEntity::setCustomParameter怎么用?C++ SubEntity::setCustomParameter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ogre::SubEntity
的用法示例。
在下文中一共展示了SubEntity::setCustomParameter方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setSegmentIndex
void RigidObject::setSegmentIndex(int segment_ind) {
segment_ind_ = segment_ind;
Ogre::SubEntity *pSub = entity_->getSubEntity(0);
// mark segment index for vertex shader
pSub->setCustomParameter(1, Ogre::Vector4(segment_ind_, 0, 0, 0));
}
示例2: update_settings
void LIRenAttachmentEntity::update_settings ()
{
if (entity == NULL)
return;
entity->setCastShadows (object->get_shadow_casting ());
entity->setRenderQueueGroup (object->get_render_queue ());
// Set the custom parameters of subentities.
const std::map<int, Ogre::Vector4>& params = object->get_custom_params ();
for (size_t subent_idx = 0 ; subent_idx < entity->getNumSubEntities () ; ++subent_idx)
{
Ogre::SubEntity* subent = entity->getSubEntity (subent_idx);
std::map<int, Ogre::Vector4>::const_iterator iter;
for (iter = params.begin () ; iter != params.end () ; iter++)
subent->setCustomParameter (iter->first, iter->second);
}
}
示例3: extractMeshPositions
RigidObject::RigidObject(std::string file_name,
Ogre::SceneManager *scene_manager, int segment_ind)
: segment_ind_{ segment_ind }, scene_manager_{ scene_manager } {
Ogre::MeshPtr object_mesh = render::loadMeshFromResource(file_name);
entity_ = scene_manager_->createEntity(file_name);
Ogre::MaterialPtr mat =
Ogre::MaterialManager::getSingleton().getByName("textured");
std::stringstream ss;
ss << "textured_" << segment_ind_;
Ogre::MaterialPtr cloned_mat = mat->clone(ss.str());
Ogre::Pass *pass = cloned_mat->getTechnique(0)->getPass(0);
Ogre::TextureUnitState *tex_unit = pass->createTextureUnitState();
Ogre::MaterialPtr tmp = Ogre::MaterialManager::getSingleton().getByName(
object_mesh->getSubMesh(0)->getMaterialName());
tex_unit->setTextureName(tmp->getTechnique(0)
->getPass(0)
->getTextureUnitState(0)
->getTextureName());
entity_->setMaterial(cloned_mat);
texture_name_ = tex_unit->getTextureName();
file_name_ = file_name;
Ogre::SubEntity *pSub = entity_->getSubEntity(0);
// mark segment index for vertex shader
pSub->setCustomParameter(1, Ogre::Vector4(segment_ind_, 0, 0, 0));
visual_node_ = scene_manager_->getRootSceneNode()->createChildSceneNode();
visual_node_->attachObject(entity_);
// store the vertex positions
extractMeshPositions(object_mesh.get());
// std::cout << "extracted " << positions_.size() << " vertices\n";
// compute the bounding box
computeBoundingBox();
}