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:
parent
304d7e544f
commit
1eafecd30c
1 changed files with 5 additions and 2 deletions
|
@ -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()
|
||||||
|
|
Loading…
Reference in a new issue