本文整理汇总了C++中ogre::Camera::getSceneManager方法的典型用法代码示例。如果您正苦于以下问题:C++ Camera::getSceneManager方法的具体用法?C++ Camera::getSceneManager怎么用?C++ Camera::getSceneManager使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ogre::Camera
的用法示例。
在下文中一共展示了Camera::getSceneManager方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: renderTextures
//.........这里部分代码省略.........
//Disable fog
Ogre::FogMode oldFogMode = sceneMgr->getFogMode();
Ogre::ColourValue oldFogColor = sceneMgr->getFogColour();
Ogre::Real oldFogDensity = sceneMgr->getFogDensity();
Ogre::Real oldFogStart = sceneMgr->getFogStart();
Ogre::Real oldFogEnd = sceneMgr->getFogEnd();
sceneMgr->setFog(Ogre::FOG_NONE);
// Get current status of the queue mode
Ogre::SceneManager::SpecialCaseRenderQueueMode OldSpecialCaseRenderQueueMode =
sceneMgr->getSpecialCaseRenderQueueMode();
//Only render the entity
sceneMgr->setSpecialCaseRenderQueueMode(Ogre::SceneManager::SCRQM_INCLUDE);
sceneMgr->addSpecialCaseRenderQueue(renderQueueGroup);
Ogre::uint8 oldRenderQueueGroup = entity->getRenderQueueGroup();
entity->setRenderQueueGroup(renderQueueGroup);
bool oldVisible = entity->getVisible();
entity->setVisible(true);
float oldMaxDistance = entity->getRenderingDistance();
entity->setRenderingDistance(0);
//Calculate the filename hash used to uniquely identity this render
std::string strKey = entityKey;
char key[32] = {0};
Ogre::uint32 i = 0;
for (std::string::const_iterator it = entityKey.begin(); it != entityKey.end(); ++it) {
key[i] ^= *it;
i = (i+1) % sizeof(key);
}
for (i = 0; i < sizeof(key); ++i)
key[i] = (key[i] % 26) + 'A';
Ogre::ResourceGroupManager::getSingleton().addResourceLocation(
GetUserDir().string(), "FileSystem", "BinFolder");
std::string fileNamePNG =
"Rendered." + std::string(key, sizeof(key)) + '.' +
Ogre::StringConverter::toString(textureSize) + ".png";
//Attempt to load the pre-render file if allowed
bool needsRegen = false;
if (!needsRegen) {
try{
texture = Ogre::TextureManager::getSingleton().load(
fileNamePNG, "BinFolder", Ogre::TEX_TYPE_2D, 0);
} catch (...) {
needsRegen = true;
}
}
if (needsRegen) {
//If this has not been pre-rendered, do so now
//Position camera
camNode->setPosition(0, 0, 0);
// TODO camNode->setOrientation(Quaternion(yaw, Vector3::UNIT_Y) * Quaternion(-pitch, Vector3::UNIT_X));
camNode->translate(Ogre::Vector3(0, 0, objDist), Ogre::Node::TS_LOCAL);
renderTarget->update();
//Save RTT to file
renderTarget->writeContentsToFile((GetUserDir() / fileNamePNG).string());
//Load the render into the appropriate texture view
texture = Ogre::TextureManager::getSingleton().load(fileNamePNG, "BinFolder", Ogre::TEX_TYPE_2D, 0);
ggTexture = ClientUI::GetTexture(GetUserDir() / fileNamePNG);
}
entity->setVisible(oldVisible);
entity->setRenderQueueGroup(oldRenderQueueGroup);
entity->setRenderingDistance(oldMaxDistance);
sceneMgr->removeSpecialCaseRenderQueue(renderQueueGroup);
// Restore original state
sceneMgr->setSpecialCaseRenderQueueMode(OldSpecialCaseRenderQueueMode);
//Re-enable mipmapping
mm->setDefaultTextureFiltering(oldMinFilter, oldMagFilter, oldMipFilter);
//Re-enable fog
sceneMgr->setFog(oldFogMode, oldFogColor, oldFogDensity, oldFogStart, oldFogEnd);
//Delete camera
renderTarget->removeViewport(0);
renderCamera->getSceneManager()->destroyCamera(renderCamera);
//Delete scene node
node->detachAllObjects();
if (oldSceneNode)
oldSceneNode->attachObject(entity);
//Delete RTT texture
assert(!renderTexture.isNull());
std::string texName2(renderTexture->getName());
renderTexture.setNull();
if (Ogre::TextureManager::getSingletonPtr())
Ogre::TextureManager::getSingleton().remove(texName2);
}
示例2: camera_get_scenemanager
//Ogre::Camera::getSceneManager() const
SceneManagerHandle camera_get_scenemanager(CameraHandle handle)
{
Ogre::Camera* camera = static_cast<Ogre::Camera*>(handle);
return static_cast<SceneManagerHandle>(camera->getSceneManager());
}