Let there be Rain!?

Kaylx

06-06-2011 09:49:12

Hey peeps,

I just integrated Caelum into our application and it's looking good. However i can't get the precipitation controller working.
I've been looking and looking at it but can't see anything wrong. I'm probably missing something stupid but i can't see it. :(

Here's my Caelum setup code.
void setupCaelum()
{
Caelum::CaelumSystem::CaelumComponent mask = static_cast<Caelum::CaelumSystem::CaelumComponent>
( Caelum::CaelumSystem::CAELUM_COMPONENT_SKY_DOME
| Caelum::CaelumSystem::CAELUM_COMPONENT_SUN
| Caelum::CaelumSystem::CAELUM_COMPONENT_MOON
| Caelum::CaelumSystem::CAELUM_COMPONENT_POINT_STARFIELD
| Caelum::CaelumSystem::CAELUM_COMPONENT_CLOUDS
| Caelum::CaelumSystem::CAELUM_COMPONENT_PRECIPITATION );

mCaelumSystem = new Caelum::CaelumSystem( Ogre::Root::getSingletonPtr(), GetSceneManager(), mask );

mRenderWindow->addListener( mCaelumSystem );
Ogre::Root::getSingletonPtr()->addFrameListener( mCaelumSystem );

mCaelumSystem->getUniversalClock()->setTimeScale(600);

mCaelumSystem->getPrecipitationController()->setPresetType( Caelum::PRECTYPE_RAIN );
mCaelumSystem->getPrecipitationController()->setIntensity( 1.0f );
mCaelumSystem->getPrecipitationController()->setSpeed( 0.01f );
mCaelumSystem->getPrecipitationController()->setManualCameraSpeed( Ogre::Vector3::ZERO );
mCaelumSystem->getPrecipitationController()->setAutoDisableThreshold(-1);

mCaelumSystem->setSceneFogDensityMultiplier(0.0001f);
mCaelumSystem->setManageSceneFog( Ogre::FOG_EXP2 );

mCaelumSystem->setEnsureSingleLightSource( true );
mCaelumSystem->setManageAmbientLight( true );
}

Any help would be great!

Thanks,
John