当前位置: 首页>>代码示例>>C++>>正文


C++ TextureUnitState::setTextureUScroll方法代码示例

本文整理汇总了C++中ogre::TextureUnitState::setTextureUScroll方法的典型用法代码示例。如果您正苦于以下问题:C++ TextureUnitState::setTextureUScroll方法的具体用法?C++ TextureUnitState::setTextureUScroll怎么用?C++ TextureUnitState::setTextureUScroll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ogre::TextureUnitState的用法示例。


在下文中一共展示了TextureUnitState::setTextureUScroll方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: setSunDirection

 void SkyDome::setSunDirection (const Ogre::Vector3& sunDir) {
     float elevation = sunDir.dotProduct (Ogre::Vector3::UNIT_Y);
     elevation = elevation * 0.5 + 0.5;
     Ogre::Pass* pass = mMaterial->getBestTechnique()->getPass(0);
     if (mShadersEnabled) {
         mParams.sunDirection.set(mParams.vpParams, sunDir.normalisedCopy());
         mParams.offset.set(mParams.fpParams, elevation);
     } else {
         Ogre::TextureUnitState* gradientsTus = pass->getTextureUnitState(0);
         gradientsTus->setTextureUScroll (elevation);
     }
 }
开发者ID:sajty,项目名称:ember,代码行数:12,代码来源:SkyDome.cpp

示例2: expandAll


//.........这里部分代码省略.........
                                      colorProperty->getAlpha()/255.0f);
            }
            break;
            case PASS_EMISSIVE:
            {
                colorProperty = static_cast<QtColorProperty*>(property);
                pass = static_cast<Ogre::Pass*>(colorProperty->mUserData);
                if (pass)
                    pass->setEmissive(colorProperty->getRed()/255.0f,
                                      colorProperty->getGreen()/255.0f,
                                      colorProperty->getBlue()/255.0f);
            }
            break;
            case PASS_SELF_ILLUMINATION:
            {
                colorProperty = static_cast<QtColorProperty*>(property);
                pass = static_cast<Ogre::Pass*>(colorProperty->mUserData);
                if (pass)
                    pass->setSelfIllumination(colorProperty->getRed()/255.0f,
                                              colorProperty->getGreen()/255.0f,
                                              colorProperty->getBlue()/255.0f);
            }
            break;
            case PASS_SHININESS:
            {
                decimalProperty = static_cast<QtDecimalProperty*>(property);
                pass = static_cast<Ogre::Pass*>(decimalProperty->mUserData);
                if (pass)
                    pass->setShininess(decimalProperty->getValue());
            }
            break;

            // Texture unit properties
            case TUS_FILTERING:
            {
                selectProperty = static_cast<QtSelectProperty*>(property);
                textureUnit = static_cast<Ogre::TextureUnitState*>(selectProperty->mUserData);
                if (textureUnit)
                {
                    if (selectProperty->getCurrentIndex() == 0)
                    {
                        textureUnit->setTextureFiltering(Ogre::FT_MIN, Ogre::FO_NONE);
                        textureUnit->setTextureFiltering(Ogre::FT_MAG, Ogre::FO_NONE);
                    }
                    else if (selectProperty->getCurrentIndex() == 1)
                    {
                        textureUnit->setTextureFiltering(Ogre::FT_MIN, Ogre::FO_POINT);
                        textureUnit->setTextureFiltering(Ogre::FT_MAG, Ogre::FO_POINT);
                    }
                    else if (selectProperty->getCurrentIndex() == 2)
                    {
                        textureUnit->setTextureFiltering(Ogre::FT_MIN, Ogre::FO_LINEAR);
                        textureUnit->setTextureFiltering(Ogre::FT_MAG, Ogre::FO_LINEAR);
                    }
                    else if (selectProperty->getCurrentIndex() == 3)
                    {
                        textureUnit->setTextureFiltering(Ogre::FT_MIN, Ogre::FO_ANISOTROPIC);
                        textureUnit->setTextureFiltering(Ogre::FT_MAG, Ogre::FO_ANISOTROPIC);
                    }
                }
            }
            break;

            case TUS_USCALE:
            {
                decimalProperty = static_cast<QtDecimalProperty*>(property);
                textureUnit = static_cast<Ogre::TextureUnitState*>(decimalProperty->mUserData);
                if (textureUnit)
                    textureUnit->setTextureUScale(decimalProperty->getValue());
            }
            break;

            case TUS_VSCALE:
            {
                decimalProperty = static_cast<QtDecimalProperty*>(property);
                textureUnit = static_cast<Ogre::TextureUnitState*>(decimalProperty->mUserData);
                if (textureUnit)
                    textureUnit->setTextureVScale(decimalProperty->getValue());
            }
            break;

            case TUS_USCROLL:
            {
                decimalProperty = static_cast<QtDecimalProperty*>(property);
                textureUnit = static_cast<Ogre::TextureUnitState*>(decimalProperty->mUserData);
                if (textureUnit)
                    textureUnit->setTextureUScroll(decimalProperty->getValue());
            }
            break;

            case TUS_VSCROLL:
            {
                decimalProperty = static_cast<QtDecimalProperty*>(property);
                textureUnit = static_cast<Ogre::TextureUnitState*>(decimalProperty->mUserData);
                if (textureUnit)
                    textureUnit->setTextureVScroll(decimalProperty->getValue());
            }
            break;
        }
    }
开发者ID:galek,项目名称:Magus,代码行数:101,代码来源:ogre_asset_material.cpp


注:本文中的ogre::TextureUnitState::setTextureUScroll方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。