本文整理汇总了C++中ogre::MaterialPtr::getOrigin方法的典型用法代码示例。如果您正苦于以下问题:C++ MaterialPtr::getOrigin方法的具体用法?C++ MaterialPtr::getOrigin怎么用?C++ MaterialPtr::getOrigin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ogre::MaterialPtr
的用法示例。
在下文中一共展示了MaterialPtr::getOrigin方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Initial
//.........这里部分代码省略.........
m_pPostFilterManager->createPostFilter("Bloom", m_pFairySystem->getViewport());
m_pPostFilterManager->createPostFilter("HeatVision", m_pFairySystem->getViewport());
m_pPostFilterManager->createPostFilter("Fade", m_pFairySystem->getViewport());
m_pPostFilterManager->createPostFilter("MotionBlur", m_pFairySystem->getViewport());
//--------------------------------------------
// 设置特效系统的声音播放函数
Fairy::LogicModel::SetPlaySoundFuncton((OnPlaySound)(g_pSoundSystem->GetPlaySoundFunc()));
Fairy::LogicModel::SetStopSoundFunction((OnStopSound)(g_pSoundSystem->GetStopSoundFunc()));
Fairy::BulletSystem::SetPlaySoundFuncton((OnPlaySound)(g_pSoundSystem->GetPlaySoundFunc()));
Fairy::BulletSystem::SetStopSoundFunction((OnStopSound)(g_pSoundSystem->GetStopSoundFunc()));
Fairy::LogicModel::SetGetHeightInWorldListener((GetHeightInWorld)(g_pWorldSystem->GetTerrainHeightFunc()));
// 初始化 fake obeject manager
m_pFakeObjectManager = new CFakeObjectEntityManager;
m_pFakeObjectManager->Initial();
// Fairy::Effect::setDefaultIterativeInterval(0.01f);
Ogre::ParticleSystem::setDefaultIterationInterval(0.033f);
// 系统设置接口挂接变量控制系统
g_pEventSys->RegisterEventHandle("VARIABLE_CHANGED",_OnVariableChangedEvent);
// 恢复上次颜色设置
g_pEventSys->PushEvent(GE_VARIABLE_CHANGED, sz32BitTexturesVar, g_pVaribleSys->GetAs_String(sz32BitTexturesVar).c_str());
// Ogre::TextureManager::getSingleton().setDefaultNumMipmaps( 1 );
// 加载人物阴影配置
BOOL bHave;
INT nHumanLightmap = g_pVaribleSys->GetAs_Float(szShadowTechniqueVar, &bHave );
if( bHave )
Scene_SetShadowTechnique( (BOOL)nHumanLightmap );
// 加载全局泛光配置
INT nFullScreenLight = g_pVaribleSys->GetAs_Float( szPostFilterEnabledVar, &bHave );
if( bHave )
Scene_SetPostFilterEnabled( (BOOL)nFullScreenLight );
//初始化小地图探灯功能
m_pMapLight = new CUIMapLight;
m_pMapLight->Initial();
}
catch(const Ogre::Exception& e)
{
BOOL rethrow = TRUE;
if (e.getNumber() == Ogre::Exception::ERR_DUPLICATE_ITEM)
{
if (e.getSource() == "ResourceManager::add")
{
if (Ogre::StringUtil::endsWith(listener._scriptName, ".material", TRUE))
{
char materialName[256];
if (sscanf(e.getDescription().c_str(), "Resource with the name %255s already exists.", materialName) == 1)
{
Ogre::MaterialPtr material = Ogre::MaterialManager::getSingleton().getByName(materialName);
if (!material.isNull())
{
char message[1024];
Ogre::StringVectorPtr currentNames = Fairy::findResourceFilenames(listener._groupName, listener._scriptName);
const Ogre::String& currentName = currentNames.isNull() || currentNames->empty() ? listener._scriptName : currentNames->front();
if (material->getOrigin().empty())
{
_snprintf(message, 1024,
("Predefined material \"%s\" duplicated in file \"%s\", the application will exit."),
material->getName().c_str(), currentName.c_str());
}
else
{
Ogre::StringVectorPtr originNames = Fairy::findResourceFilenames(material->getGroup(), material->getOrigin());
const Ogre::String& originName = originNames.isNull() || originNames->empty() ? material->getOrigin() : originNames->front();
if (currentName == originName)
{
_snprintf(message, 1024,
("The material \"%s\" occuring in the file \"%s\" more than once, the application will exit."),
material->getName().c_str(), currentName.c_str());
}
else
{
_snprintf(message, 1024,
("Duplicate material \"%s\" in files \"%s\" and \"%s\", the application will exit."),
material->getName().c_str(), currentName.c_str(), originName.c_str());
}
}
KLThrow("Ogre::%s", message);
}
}
}
}
}
throw;
}
}
示例2: Initial
//.........这里部分代码省略.........
FLOAT fCamera_MaxDistance = g_pVaribleSys->GetAs_Float("Camera_MaxDistance", &bHave);
if(bHave) CCamera_Scene::MAX_DISTANCE = fCamera_MaxDistance;
FLOAT fCamera_Pitch = g_pVaribleSys->GetAs_Float("Camera_Pitch", &bHave);
if(bHave) CCamera_Scene::STATIC_PITCH = -fCamera_Pitch*TDU_PI/180.0f;
}
m_pCamera_CharView = new CCamera_CharSel(m_pRenderSystem->getCamera());
m_pCamera_Scene = new CCamera_Scene(m_pRenderSystem->getCamera());
m_pCamera_Scene->SetDistance(CCamera_Scene::MAX_DISTANCE);
m_pCamera_Current = m_pCamera_CharView;
//--------------------------------------------
//初始化PostFilter系统
m_pPostFilterManager = m_pRenderSystem->getPostFilterManager();
//注册所有全局渲染器
WX::registerAllPostFilterFactories(m_pPostFilterManager);
m_pPostFilterManager->createPostFilter("Floodlighting", m_pRenderSystem->getViewport());
// m_pPostFilterManager->createPostFilter("Bloom", m_pRenderSystem->getViewport());
// m_pPostFilterManager->createPostFilter("HeatVision", m_pRenderSystem->getViewport());
m_pPostFilterManager->createPostFilter("Fade", m_pRenderSystem->getViewport());
//--------------------------------------------
//设置特效系统的声音播放函数
WX::LogicModel::SetPlaySoundFuncton((OnPlaySound)(g_pSoundSystem->GetPlaySoundFunc()));
WX::LogicModel::SetStopSoundFunction((OnStopSound)(g_pSoundSystem->GetStopSoundFunc()));
WX::LogicModel::SetGetHeightInWorldListener((GetHeightInWorld)(g_pWorldSystem->GetTerrainHeightFunc()));
// 初始化 fake obeject manager
m_pFakeObjectManager = new CFakeObjectManager;
m_pFakeObjectManager->Initial();
// WX::Effect::setDefaultIterativeInterval(0.01f);
Ogre::ParticleSystem::setDefaultIterationInterval(0.033f);
//系统设置接口挂接变量控制系统
g_pEventSys->RegisterEventHandle("VARIABLE_CHANGED",_OnVariableChangedEvent);
//恢复上次颜色设置
g_pEventSys->PushEvent(
GE_VARIABLE_CHANGED,
sz32BitTexturesVar,
g_pVaribleSys->GetAs_String(sz32BitTexturesVar).c_str());
}
catch(const Ogre::Exception& e)
{
BOOL rethrow = TRUE;
if (e.getNumber() == Ogre::Exception::ERR_DUPLICATE_ITEM)
{
if (e.getSource() == "ResourceManager::add")
{
if (Ogre::StringUtil::endsWith(listener._scriptName, ".material", TRUE))
{
char materialName[256];
if (sscanf(e.getDescription().c_str(), "Resource with the name %255s already exists.", materialName) == 1)
{
Ogre::MaterialPtr material = Ogre::MaterialManager::getSingleton().getByName(materialName);
if (!material.isNull())
{
char message[1024];
Ogre::StringVectorPtr currentNames = WX::findResourceFilenames(listener._groupName, listener._scriptName);
const Ogre::String& currentName = currentNames.isNull() || currentNames->empty() ? listener._scriptName : currentNames->front();
if (material->getOrigin().empty())
{
_snprintf(message, 1024,
("Predefined material \"%s\" duplicated in file \"%s\", the application will exit."),
material->getName().c_str(), currentName.c_str());
}
else
{
Ogre::StringVectorPtr originNames = WX::findResourceFilenames(material->getGroup(), material->getOrigin());
const Ogre::String& originName = originNames.isNull() || originNames->empty() ? material->getOrigin() : originNames->front();
if (currentName == originName)
{
_snprintf(message, 1024,
("The material \"%s\" occuring in the file \"%s\" more than once, the application will exit."),
material->getName().c_str(), currentName.c_str());
}
else
{
_snprintf(message, 1024,
("Duplicate material \"%s\" in files \"%s\" and \"%s\", the application will exit."),
material->getName().c_str(), currentName.c_str(), originName.c_str());
}
}
TDThrow("Ogre::%s", message);
}
}
}
}
}
throw;
}
}