mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-23 15:40:42 +00:00
Fix water ripples
This commit is contained in:
parent
57b7cac13f
commit
9bc6f2d5f6
@ -127,7 +127,6 @@ void RippleSimulation::update(float dt)
|
|||||||
}
|
}
|
||||||
|
|
||||||
osg::Vec3f currentPos (it->mPtr.getRefData().getPosition().asVec3());
|
osg::Vec3f currentPos (it->mPtr.getRefData().getPosition().asVec3());
|
||||||
currentPos.z() = 0; // Z is set by the Scene Node
|
|
||||||
|
|
||||||
if ( (currentPos - it->mLastEmitPosition).length() > 10
|
if ( (currentPos - it->mLastEmitPosition).length() > 10
|
||||||
// Only emit when close to the water surface, not above it and not too deep in the water
|
// 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;
|
it->mLastEmitPosition = currentPos;
|
||||||
|
|
||||||
|
currentPos.z() = mParticleNode->getPosition().z();
|
||||||
|
|
||||||
if (mParticleSystem->numParticles()-mParticleSystem->numDeadParticles() > 500)
|
if (mParticleSystem->numParticles()-mParticleSystem->numDeadParticles() > 500)
|
||||||
continue; // TODO: remove the oldest particle to make room?
|
continue; // TODO: remove the oldest particle to make room?
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user