From 1eafecd30c99c2a84e48139d5515a65265477114 Mon Sep 17 00:00:00 2001 From: scrawl Date: Sun, 5 Apr 2015 00:02:35 +0200 Subject: [PATCH] Add magic factor as in vanilla MW to gravity affector (Bug #2147) --- components/nifosg/particle.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/components/nifosg/particle.cpp b/components/nifosg/particle.cpp index c86a79af8..143a73e08 100644 --- a/components/nifosg/particle.cpp +++ b/components/nifosg/particle.cpp @@ -183,19 +183,22 @@ void GravityAffector::beginOperate(osgParticle::Program* program) void GravityAffector::operate(osgParticle::Particle *particle, double dt) { + const float magic = 1.6f; switch (mType) { case Type_Wind: - particle->addVelocity(mCachedWorldPositionDirection * mForce * dt); + particle->addVelocity(mCachedWorldPositionDirection * mForce * dt * magic); break; case Type_Point: { osg::Vec3f diff = mCachedWorldPositionDirection - particle->getPosition(); diff.normalize(); - particle->addVelocity(diff * mForce * dt); + particle->addVelocity(diff * mForce * dt * magic); break; } } + + // velocity *= e^-[(dist/decay)^2] } Emitter::Emitter()