From 013916fca3c92841e8aad016e5c77b639ebed9d4 Mon Sep 17 00:00:00 2001 From: scrawl Date: Wed, 11 Jun 2014 18:59:51 +0200 Subject: [PATCH] Fix for broken physics in exteriors (Fixes #1446) The wrong function was being used to check the distance between old and new positions. It took the length of the vectors into account, which makes no sense for positions. The issue was only observed in exteriors, since most interiors are relatively close to the origin. --- apps/openmw/mwworld/physicssystem.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/openmw/mwworld/physicssystem.cpp b/apps/openmw/mwworld/physicssystem.cpp index 0f6fdec19..73a704c88 100644 --- a/apps/openmw/mwworld/physicssystem.cpp +++ b/apps/openmw/mwworld/physicssystem.cpp @@ -304,7 +304,7 @@ namespace MWWorld continue; // velocity updated, calculate nextpos again } - if(!newPosition.positionCloses(nextpos, 0.00000001)) + if(newPosition.squaredDistance(nextpos) > 0.00000001*0.00000001) { // trace to where character would go if there were no obstructions tracer.doTrace(colobj, newPosition, nextpos, engine);