|
|
|
@ -32,7 +32,6 @@ Water::Water (Ogre::Camera *camera, RenderingManager* rend, const ESM::Cell* cel
|
|
|
|
|
mIsUnderwater(false), mVisibilityFlags(0),
|
|
|
|
|
mReflectionTarget(0), mActive(1), mToggled(1),
|
|
|
|
|
mReflectionRenderActive(false), mRendering(rend),
|
|
|
|
|
mOldFarClip(0), mOldFarClip2(0),
|
|
|
|
|
mWaterTimer(0.f)
|
|
|
|
|
{
|
|
|
|
|
mSky = rend->getSkyManager();
|
|
|
|
@ -267,34 +266,19 @@ void Water::renderQueueStarted (Ogre::uint8 queueGroupId, const Ogre::String &in
|
|
|
|
|
// We don't want the sky to get clipped by custom near clip plane (the water plane)
|
|
|
|
|
if (queueGroupId < 20 && mReflectionRenderActive)
|
|
|
|
|
{
|
|
|
|
|
mOldFarClip = mReflectionCamera->getFarClipDistance ();
|
|
|
|
|
mReflectionCamera->disableCustomNearClipPlane();
|
|
|
|
|
mReflectionCamera->setFarClipDistance (1000000000);
|
|
|
|
|
Root::getSingleton().getRenderSystem()->_setProjectionMatrix(mReflectionCamera->getProjectionMatrixRS());
|
|
|
|
|
}
|
|
|
|
|
else if (queueGroupId == RQG_UnderWater)
|
|
|
|
|
{/*
|
|
|
|
|
mOldFarClip2 = mCamera->getFarClipDistance ();
|
|
|
|
|
mCamera->setFarClipDistance (1000000000);
|
|
|
|
|
Root::getSingleton().getRenderSystem()->_setProjectionMatrix(mCamera->getProjectionMatrixRS());
|
|
|
|
|
*/}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Water::renderQueueEnded (Ogre::uint8 queueGroupId, const Ogre::String &invocation, bool &repeatThisInvocation)
|
|
|
|
|
{
|
|
|
|
|
if (queueGroupId < 20 && mReflectionRenderActive)
|
|
|
|
|
{
|
|
|
|
|
mReflectionCamera->setFarClipDistance (mOldFarClip);
|
|
|
|
|
if (!mIsUnderwater)
|
|
|
|
|
mReflectionCamera->enableCustomNearClipPlane(mErrorPlane);
|
|
|
|
|
Root::getSingleton().getRenderSystem()->_setProjectionMatrix(mReflectionCamera->getProjectionMatrixRS());
|
|
|
|
|
}
|
|
|
|
|
if (queueGroupId == RQG_UnderWater)
|
|
|
|
|
{
|
|
|
|
|
/*
|
|
|
|
|
mCamera->setFarClipDistance (mOldFarClip2);
|
|
|
|
|
Root::getSingleton().getRenderSystem()->_setProjectionMatrix(mCamera->getProjectionMatrixRS());
|
|
|
|
|
*/}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Water::update(float dt)
|
|
|
|
|