Make idle emitters emit ripples every 1.5 seconds (bug #5883)

7098-improve-post-process-behavior-with-transparent-objects
Alexei Kotov 2 years ago
parent 3ca17e5183
commit a5adb73900

@ -8,6 +8,7 @@
Bug #5129: Stuttering animation on Centurion Archer
Bug #5714: Touch spells cast using ExplodeSpell don't always explode
Bug #5849: Paralysis breaks landing
Bug #5883: Immobile creatures don't cause water ripples
Bug #5977: Fatigueless NPCs' corpse underwater changes animation on game load
Bug #6427: Enemy health bar disappears before damaging effect ends
Bug #6645: Enemy block sounds align with animation instead of blocked hits

@ -127,6 +127,7 @@ namespace MWRender
const MWBase::World* world = MWBase::Environment::get().getWorld();
for (Emitter& emitter : mEmitters)
{
emitter.mTimer -= dt;
MWWorld::ConstPtr& ptr = emitter.mPtr;
if (ptr == MWBase::Environment::get().getWorld()->getPlayerPtr())
{
@ -139,9 +140,13 @@ namespace MWRender
bool shouldEmit = (world->isUnderwater(ptr.getCell(), currentPos) && !world->isSubmerged(ptr))
|| world->isWalkingOnWater(ptr);
if (shouldEmit && (currentPos - emitter.mLastEmitPosition).length() > 10)
if (!shouldEmit)
emitter.mTimer = 0.f;
else if (emitter.mTimer <= 0.f || (currentPos - emitter.mLastEmitPosition).length() > 10)
{
emitter.mLastEmitPosition = currentPos;
emitter.mTimer = 1.5f;
currentPos.z() = mParticleNode->getPosition().z();
@ -160,6 +165,7 @@ namespace MWRender
newEmitter.mScale = scale;
newEmitter.mForce = force;
newEmitter.mLastEmitPosition = osg::Vec3f(0, 0, 0);
newEmitter.mTimer = 0.f;
mEmitters.push_back(newEmitter);
}

@ -35,6 +35,7 @@ namespace MWRender
osg::Vec3f mLastEmitPosition;
float mScale;
float mForce;
float mTimer;
};
class RippleSimulation

Loading…
Cancel
Save