1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-16 21:49:55 +00:00

Add magic factor as in vanilla MW to gravity affector (Bug #2147)

This commit is contained in:
scrawl 2015-04-05 00:02:35 +02:00
parent 304d7e544f
commit 1eafecd30c

View file

@ -183,19 +183,22 @@ void GravityAffector::beginOperate(osgParticle::Program* program)
void GravityAffector::operate(osgParticle::Particle *particle, double dt) void GravityAffector::operate(osgParticle::Particle *particle, double dt)
{ {
const float magic = 1.6f;
switch (mType) switch (mType)
{ {
case Type_Wind: case Type_Wind:
particle->addVelocity(mCachedWorldPositionDirection * mForce * dt); particle->addVelocity(mCachedWorldPositionDirection * mForce * dt * magic);
break; break;
case Type_Point: case Type_Point:
{ {
osg::Vec3f diff = mCachedWorldPositionDirection - particle->getPosition(); osg::Vec3f diff = mCachedWorldPositionDirection - particle->getPosition();
diff.normalize(); diff.normalize();
particle->addVelocity(diff * mForce * dt); particle->addVelocity(diff * mForce * dt * magic);
break; break;
} }
} }
// velocity *= e^-[(dist/decay)^2]
} }
Emitter::Emitter() Emitter::Emitter()