Fix the ObstacleCheck time step (Fixes #3211)

move
scrawl 9 years ago
parent 195c3b9967
commit a97eae864d

@ -120,14 +120,10 @@ namespace MWMechanics
const MWWorld::Class& cls = actor.getClass();
ESM::Position pos = actor.getRefData().getPosition();
// actors can move at most 60 fps (the physics framerate).
// the max() can be removed if we implement physics interpolation.
float movementDuration = std::max(1/60.f, duration);
if(mDistSameSpot == -1)
mDistSameSpot = DIST_SAME_SPOT * cls.getSpeed(actor);
float distSameSpot = mDistSameSpot * movementDuration;
float distSameSpot = mDistSameSpot * duration;
bool samePosition = (osg::Vec2f(pos.pos[0], pos.pos[1]) - osg::Vec2f(mPrevX, mPrevY)).length2() < distSameSpot * distSameSpot;

Loading…
Cancel
Save