From 9bc6f2d5f65866095e690332dacc8b7e56baf345 Mon Sep 17 00:00:00 2001 From: scrawl Date: Wed, 9 Dec 2015 20:35:51 +0100 Subject: [PATCH] Fix water ripples --- apps/openmw/mwrender/ripplesimulation.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/openmw/mwrender/ripplesimulation.cpp b/apps/openmw/mwrender/ripplesimulation.cpp index 766e20fc4..7439bfc70 100644 --- a/apps/openmw/mwrender/ripplesimulation.cpp +++ b/apps/openmw/mwrender/ripplesimulation.cpp @@ -127,7 +127,6 @@ void RippleSimulation::update(float dt) } osg::Vec3f currentPos (it->mPtr.getRefData().getPosition().asVec3()); - currentPos.z() = 0; // Z is set by the Scene Node if ( (currentPos - it->mLastEmitPosition).length() > 10 // Only emit when close to the water surface, not above it and not too deep in the water @@ -136,6 +135,8 @@ void RippleSimulation::update(float dt) { it->mLastEmitPosition = currentPos; + currentPos.z() = mParticleNode->getPosition().z(); + if (mParticleSystem->numParticles()-mParticleSystem->numDeadParticles() > 500) continue; // TODO: remove the oldest particle to make room?