本文整理汇总了C++中technique::PassIterator::peekNext方法的典型用法代码示例。如果您正苦于以下问题:C++ PassIterator::peekNext方法的具体用法?C++ PassIterator::peekNext怎么用?C++ PassIterator::peekNext使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类technique::PassIterator
的用法示例。
在下文中一共展示了PassIterator::peekNext方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setColor
void MaterialInstance::setColor(float red, float green, float blue, float alpha)
{
if (mCopyMat.isNull ()) {
createCopyMaterial ();
}
unsigned short i = 0, j;
ColourValue sc, dc; // Source colur, destination colour
Material::TechniqueIterator techniqueIt = mCopyMat->getTechniqueIterator ();
while (techniqueIt.hasMoreElements ())
{
Technique *t = techniqueIt.getNext ();
Technique::PassIterator passIt = t->getPassIterator ();
j = 0;
while (passIt.hasMoreElements ())
{
sc = mOriginalMat->getTechnique (i)->getPass (j)->getDiffuse ();
dc = sc;
dc.a = alpha;
dc.r = red;
dc.g = green;
dc.b = blue;
passIt.peekNext ()->setAmbient (mOriginalMat->getTechnique (i)->getPass (j)->getAmbient ());
passIt.peekNext ()->setDiffuse (dc);
passIt.moveNext ();
++j;
}
++i;
}
}
示例2: ChangeOriginalMaterial
void MaterialInstance::ChangeOriginalMaterial()
{
if (mCopyMat.isNull ()) {
createCopyMaterial ();
}
unsigned short i = 0, j;
ColourValue sc, dc; // Source colur, destination colour
Material::TechniqueIterator techniqueIt = mCopyMat->getTechniqueIterator ();
while (techniqueIt.hasMoreElements ())
{
Technique *t = techniqueIt.getNext ();
Technique::PassIterator passIt = t->getPassIterator ();
j = 0;
while (passIt.hasMoreElements ())
{
sc = mOriginalMat->getTechnique (i)->getPass (j)->getDiffuse ();
passIt.peekNext ()->setAmbient (mOriginalMat->getTechnique (i)->getPass (j)->getAmbient ());
passIt.peekNext ()->setDiffuse (sc);
passIt.moveNext ();
++j;
}
++i;
}
}
示例3: setTransparency
void MaterialInstance::setTransparency (Real transparency) {
mCurrentTransparency = transparency;
if (mCurrentTransparency > 0.0f) {
if (mCurrentTransparency > 1.0f)
mCurrentTransparency = 1.0f;
if (mCopyMat.isNull ()) {
createCopyMaterial ();
}
unsigned short i = 0, j;
ColourValue sc, dc; // Source colur, destination colour
Material::TechniqueIterator techniqueIt = mCopyMat->getTechniqueIterator ();
while (techniqueIt.hasMoreElements ()) {
Technique *t = techniqueIt.getNext ();
Technique::PassIterator passIt = t->getPassIterator ();
j = 0;
while (passIt.hasMoreElements ()) {
sc = mOriginalMat->getTechnique (i)->getPass (j)->getDiffuse ();
switch (mSBT) {
case SBT_ADD:
dc = sc;
dc.r -= sc.r * mCurrentTransparency;
dc.g -= sc.g * mCurrentTransparency;
dc.b -= sc.b * mCurrentTransparency;
passIt.peekNext ()->setAmbient (ColourValue::Black);
break;
case SBT_TRANSPARENT_ALPHA:
default:
dc = sc;
dc.a = sc.a * (1.0f - mCurrentTransparency);
passIt.peekNext ()->setAmbient (mOriginalMat->getTechnique (i)->getPass (j)->getAmbient ());
break;
}
passIt.peekNext ()->setDiffuse (dc);
passIt.moveNext ();
++j;
}
++i;
}
}
else {
mCurrentTransparency = 0.0f;
}
}
示例4: createCopyMaterial
void MaterialInstance::createCopyMaterial () {
String name;
// Avoid name collision
do {
name = mOriginalMat->getName () + StringConverter::toString (Math::UnitRandom ());
} while (MaterialManager::getSingleton ().resourceExists (name));
mCopyMat = mOriginalMat->clone (name);
Material::TechniqueIterator techniqueIt = mCopyMat->getTechniqueIterator ();
while (techniqueIt.hasMoreElements ()) {
Technique *t = techniqueIt.getNext ();
Technique::PassIterator passIt = t->getPassIterator ();
while (passIt.hasMoreElements ()) {
passIt.peekNext ()->setDepthWriteEnabled (false);
passIt.peekNext ()->setSceneBlending (mSBT);
passIt.moveNext ();
}
}
}
示例5: subEntityAction
//===========================================================================
// MaterialPassAction
//===========================================================================
void IMaterialPassAction::subEntityAction( SubEntityMaterial* subEntity ) const
{
if( !subEntity->getMaterial().isNull() )
{
unsigned short i = 0 ;
for( Material::TechniqueIterator techniqueIt = subEntity->getMaterial()->getTechniqueIterator() ;
techniqueIt.hasMoreElements() ;
techniqueIt.moveNext(), ++i )
{
Technique* techniqueScr = subEntity->getMaterial()->getTechnique( i ) ;
unsigned short j = 0;
for( Technique::PassIterator passIt = techniqueIt.peekNext()->getPassIterator ();
passIt.hasMoreElements() ;
passIt.moveNext(), ++j )
{
passAction( subEntity, passIt.peekNext(), techniqueScr->getPass( j ) ) ;
}
}
}
}