本文整理汇总了C++中ogre::MaterialPtr::getCreator方法的典型用法代码示例。如果您正苦于以下问题:C++ MaterialPtr::getCreator方法的具体用法?C++ MaterialPtr::getCreator怎么用?C++ MaterialPtr::getCreator使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ogre::MaterialPtr
的用法示例。
在下文中一共展示了MaterialPtr::getCreator方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SetSelectLook
// 设置选中的外观颜色.
void CEditDobject_NT::SetSelectLook(Ogre::ColourValue color)
{
if(0 == m_materialSelVector.size())
{
// 选中材质的名字.
Ogre::String strCloneName;
int iCount = m_EntityList.size();
Ogre::Entity* pEntity = NULL;
for(int i = 0; i < iCount; i++)
{
pEntity = m_EntityList[i].pEntity;
if(pEntity)
{
Ogre::SubEntity* pSubEntiy = pEntity->getSubEntity(0);
if(pSubEntiy)
{
Ogre::MaterialPtr pMaterial = pSubEntiy->getMaterial();
if(pMaterial.isNull())
{
return;
}//
const Ogre::String& strName = pMaterial->getName();
if("BaseWhite" == strName)
{
continue;
}
strCloneName = strName;
strCloneName += "_select";
Ogre::MaterialManager* pMaterialManager = (Ogre::MaterialManager*)(pMaterial->getCreator());
if(NULL == pMaterialManager)
{
return;
}
Ogre::MaterialPtr pMaterialClone = pMaterialManager->getByName(strCloneName);
if(pMaterialClone.isNull())
{
pMaterialClone = pMaterial->clone(strCloneName);
}
//if(!pMaterialClone)
//{
// return;
//}//
Ogre::Technique* pTechnique = pMaterialClone->getBestTechnique();
Ogre::Pass* pPass = pTechnique->getPass(0);
//pPass->setSceneBlending(SBT_ADD);
//pPass->setSceneBlending(SBF_SOURCE_ALPHA , SBF_ONE_MINUS_SOURCE_ALPHA );
//pTextureState->setAlphaOperation(LBX_MODULATE, LBS_TEXTURE, LBS_MANUAL, 1, Transparence, 1);//
Ogre::TextureUnitState* pTextureState = pPass->getTextureUnitState(0);
pTextureState->setColourOperationEx(Ogre::LBX_ADD , Ogre::LBS_TEXTURE , Ogre::LBS_MANUAL, color, color );
pSubEntiy->setMaterialName(strCloneName);
m_materialSelVector.push_back(pMaterialClone);
m_materilaOldVector.push_back(pMaterial);
}
}
}
}
else
{
int iIndex = 0;
int iCount = m_EntityList.size();
Ogre::Entity* pEntity = NULL;
for(int i = 0; i < iCount; i++)
{
pEntity = m_EntityList[i].pEntity;
if(pEntity)
{
Ogre::SubEntity* pSubEntiy = pEntity->getSubEntity(0);
if(pSubEntiy)
{
if(iIndex >= (int)m_materialSelVector.size())
{
continue;
}
std::string strMaterialName = m_materialSelVector[iIndex]->getName();
pSubEntiy->setMaterialName(strMaterialName);
iIndex++;
}
}
//.........这里部分代码省略.........