mirror of
https://github.com/OpenMW/openmw.git
synced 2025-06-19 03:11:34 +00:00
Merge branch 'emitbrown' into 'master'
Make idle emitters emit ripples every 1.5 seconds (bug #5883) Closes #5883 See merge request OpenMW/openmw!2501
This commit is contained in:
commit
5e3c347bf7
3 changed files with 9 additions and 1 deletions
|
@ -8,6 +8,7 @@
|
||||||
Bug #5129: Stuttering animation on Centurion Archer
|
Bug #5129: Stuttering animation on Centurion Archer
|
||||||
Bug #5714: Touch spells cast using ExplodeSpell don't always explode
|
Bug #5714: Touch spells cast using ExplodeSpell don't always explode
|
||||||
Bug #5849: Paralysis breaks landing
|
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 #5977: Fatigueless NPCs' corpse underwater changes animation on game load
|
||||||
Bug #6427: Enemy health bar disappears before damaging effect ends
|
Bug #6427: Enemy health bar disappears before damaging effect ends
|
||||||
Bug #6645: Enemy block sounds align with animation instead of blocked hits
|
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();
|
const MWBase::World* world = MWBase::Environment::get().getWorld();
|
||||||
for (Emitter& emitter : mEmitters)
|
for (Emitter& emitter : mEmitters)
|
||||||
{
|
{
|
||||||
|
emitter.mTimer -= dt;
|
||||||
MWWorld::ConstPtr& ptr = emitter.mPtr;
|
MWWorld::ConstPtr& ptr = emitter.mPtr;
|
||||||
if (ptr == MWBase::Environment::get().getWorld()->getPlayerPtr())
|
if (ptr == MWBase::Environment::get().getWorld()->getPlayerPtr())
|
||||||
{
|
{
|
||||||
|
@ -139,9 +140,13 @@ namespace MWRender
|
||||||
|
|
||||||
bool shouldEmit = (world->isUnderwater(ptr.getCell(), currentPos) && !world->isSubmerged(ptr))
|
bool shouldEmit = (world->isUnderwater(ptr.getCell(), currentPos) && !world->isSubmerged(ptr))
|
||||||
|| world->isWalkingOnWater(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.mLastEmitPosition = currentPos;
|
||||||
|
emitter.mTimer = 1.5f;
|
||||||
|
|
||||||
currentPos.z() = mParticleNode->getPosition().z();
|
currentPos.z() = mParticleNode->getPosition().z();
|
||||||
|
|
||||||
|
@ -160,6 +165,7 @@ namespace MWRender
|
||||||
newEmitter.mScale = scale;
|
newEmitter.mScale = scale;
|
||||||
newEmitter.mForce = force;
|
newEmitter.mForce = force;
|
||||||
newEmitter.mLastEmitPosition = osg::Vec3f(0, 0, 0);
|
newEmitter.mLastEmitPosition = osg::Vec3f(0, 0, 0);
|
||||||
|
newEmitter.mTimer = 0.f;
|
||||||
mEmitters.push_back(newEmitter);
|
mEmitters.push_back(newEmitter);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -35,6 +35,7 @@ namespace MWRender
|
||||||
osg::Vec3f mLastEmitPosition;
|
osg::Vec3f mLastEmitPosition;
|
||||||
float mScale;
|
float mScale;
|
||||||
float mForce;
|
float mForce;
|
||||||
|
float mTimer;
|
||||||
};
|
};
|
||||||
|
|
||||||
class RippleSimulation
|
class RippleSimulation
|
||||||
|
|
Loading…
Reference in a new issue