本文整理汇总了C++中ogre::Entity::addQueryFlags方法的典型用法代码示例。如果您正苦于以下问题:C++ Entity::addQueryFlags方法的具体用法?C++ Entity::addQueryFlags怎么用?C++ Entity::addQueryFlags使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ogre::Entity
的用法示例。
在下文中一共展示了Entity::addQueryFlags方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CreateOcean
// Create the scene node for the ocean. We create a plane, add the ocean material, create a scene node
// and add the plane to the scene node and return that scene node.
// BETWEEN FRAME OPERATION
Ogre::SceneNode* Region::CreateOcean(Ogre::SceneNode* regionNode,
const float width, const float length, const float waterHeight, Ogre::String waterName) {
Ogre::Plane* oceanPlane = new Ogre::Plane(0.0, 0.0, 1.0, 0);
Ogre::MeshPtr oceanMesh = Ogre::MeshManager::getSingleton().createPlane(waterName, OLResourceGroupName,
*oceanPlane, width, length,
2, 2, true,
2, 2.0, 2.0, Ogre::Vector3::UNIT_Y);
Ogre::String oceanMaterialName = LG::GetParameter("Renderer.Ogre.OceanMaterialName");
LG::Log("Region::CreateOcean: r=%s, h=%f, n=%s, m=%s",
regionNode->getName().c_str(), waterHeight, waterName.c_str(), oceanMaterialName.c_str());
oceanMesh->getSubMesh(0)->setMaterialName(oceanMaterialName);
Ogre::Entity* oceanEntity = LG::RendererOgre::Instance()->m_sceneMgr->createEntity("WaterEntity/" + waterName, oceanMesh->getName());
oceanEntity->addQueryFlags(Ogre::SceneManager::WORLD_GEOMETRY_TYPE_MASK);
oceanEntity->setCastShadows(false);
Ogre::SceneNode* oceanNode = regionNode->createChildSceneNode("WaterSceneNode/" + waterName);
oceanNode->setInheritOrientation(true);
oceanNode->setInheritScale(false);
oceanNode->translate(width/2.0f, length/2.0f, waterHeight);
oceanNode->attachObject(oceanEntity);
return oceanNode;
}