本文整理汇总了C++中ogre::TextureUnitState::getEffects方法的典型用法代码示例。如果您正苦于以下问题:C++ TextureUnitState::getEffects方法的具体用法?C++ TextureUnitState::getEffects怎么用?C++ TextureUnitState::getEffects使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ogre::TextureUnitState
的用法示例。
在下文中一共展示了TextureUnitState::getEffects方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: rotateTexture
//-----------------------------------------------------------------------
void PrimitiveShapeSet::rotateTexture(Ogre::Real speed)
{
// Get the material and rotate it, assume the material is loaded already, otherwise skip.
Ogre::MaterialPtr material = getMaterial();
if (material.isNull())
return;
Ogre::TextureUnitState::EffectMap::const_iterator it;
unsigned short numberOfTechniques = material->getNumTechniques();
for (unsigned short u = 0; u < numberOfTechniques; ++u)
{
Ogre::Technique* technique = material->getTechnique(u);
unsigned short numberOfPasses = technique->getNumPasses();
for (unsigned short v = 0; v < numberOfPasses; ++v)
{
Ogre::Pass* pass = technique->getPass(v);
unsigned short numberOfTextureUnitStates = pass->getNumTextureUnitStates();
for (unsigned short w = 0; w < numberOfTextureUnitStates; ++w)
{
// Set the rotation if not already available.
// This can only be done once! Changing the rotationspeed or removing the rotation
// and resetting it doesn´t seem to work.
Ogre::TextureUnitState* textureUnitState = pass->getTextureUnitState(w);
it = textureUnitState->getEffects().find(Ogre::TextureUnitState::ET_ROTATE);
if (it == textureUnitState->getEffects().end())
{
textureUnitState->setRotateAnimation(speed);
}
}
}
}
}
示例2: _rotateTexture
//-----------------------------------------------------------------------
void EntityRenderer::_rotateTexture(VisualParticle* particle, Ogre::Entity* entity)
{
Ogre::TextureUnitState::EffectMap::const_iterator it;
// Get the material and rotate it
unsigned int numberOfSubEntities = entity->getNumSubEntities();
for (unsigned short u = 0; u < numberOfSubEntities; ++u)
{
Ogre::MaterialPtr material = entity->getSubEntity(u)->getMaterial();
unsigned short numberOfTechniques = material->getNumTechniques();
for (unsigned short v = 0; v < numberOfTechniques; ++v)
{
Ogre::Technique* technique = material->getTechnique(v);
unsigned short numberOfPasses = technique->getNumPasses();
for (unsigned short w = 0; w < numberOfPasses; ++w)
{
Ogre::Pass* pass = technique->getPass(w);
unsigned short numberOfTextureUnitStates = pass->getNumTextureUnitStates();
for (unsigned short x = 0; x < numberOfTextureUnitStates; ++x)
{
// Set the rotation if not already available.
// This can only be done once! Changing the rotationspeed or removing the rotation
// and resetting it doesn´t seem to work.
Ogre::TextureUnitState* textureUnitState = pass->getTextureUnitState(x);
it = textureUnitState->getEffects().find(Ogre::TextureUnitState::ET_ROTATE);
if (it == textureUnitState->getEffects().end())
{
textureUnitState->setRotateAnimation((particle->zRotationSpeed.valueRadians()));
}
}
}
}
}
}
示例3: inspectPass
GBufferSchemeHandler::PassProperties GBufferSchemeHandler::inspectPass(
Ogre::Pass* pass, unsigned short lodIndex, const Ogre::Renderable* rend)
{
PassProperties props;
//TODO : Use renderable to indicate whether this has skinning.
//Probably use same const cast that renderSingleObject uses.
if (pass->hasVertexProgram())
{
props.isSkinned = pass->getVertexProgram()->isSkeletalAnimationIncluded();
}
else
{
props.isSkinned = false;
}
for (unsigned short i=0; i<pass->getNumTextureUnitStates(); i++)
{
Ogre::TextureUnitState* tus = pass->getTextureUnitState(i);
Ogre::String texName = tus->getTextureName();
if (!checkNormalMap(tus, props))
{
props.regularTextures.push_back(tus);
}
if (tus->getEffects().size() > 0)
{
props.isDeferred = false;
}
}
if (pass->getDiffuse() != Ogre::ColourValue::White)
{
props.hasDiffuseColour = true;
}
//Check transparency
if (pass->getDestBlendFactor() != Ogre::SBF_ZERO)
{
//TODO : Better ways to do this
props.isDeferred = false;
}
return props;
}