I have visibility masks as follows:
Code: Select all
VISIBILITY_MASK_DEFAULT=1<<0,
VISIBILITY_MASK_RADAR=1<<1,
VISIBILITY_MASK_ROOFS=1<<2,
VISIBILITY_MASK_TRIGGER_VOLUME=1<<3,
Code: Select all
int visibilityMask = GetApp()->GetSceneManager()->getVisibilityMask();
GetApp()->GetSceneManager()->setVisibilityMask(visibilityMask | VISIBILITY_MASK_ROOFS);
Code: Select all
unsigned int oldVisibilityMask = sceneManager->getVisibilityMask();
// BUG - Proves that the visibility masks are fixed at whatever I set it to be the first time I ever render it
// Changing visibility masks during runtime has no effect!
static bool firstCall=true;
if (firstCall)
oldVisibilityMask=(1<<2) | (1<<0);
Ogre::ShadowTechnique oldShadowTechnique = sceneManager->getShadowTechnique();
if (oldShadowTechnique!=Ogre::SHADOWTYPE_NONE)
sceneManager->setShadowTechnique(Ogre::SHADOWTYPE_NONE);
unsigned i;
for (i=0; i < ti->getNumTargetPasses(); i++)
ti->getTargetPass(i)->setVisibilityMask(oldVisibilityMask);
shieldGroup->update(curTimeMS);
distortionRenderTarget->update();
shieldGroup->hideGroup();
Ogre::MaterialManager::getSingleton().setActiveScheme(currentScheme);
if (oldShadowTechnique!=Ogre::SHADOWTYPE_NONE)
sceneManager->setShadowTechnique(oldShadowTechnique);
sceneManager->setVisibilityMask(oldVisibilityMask);
Is there some function I need to call, or maybe I am calling these things out of order?