summaryrefslogtreecommitdiff
path: root/indra/newview/llphysicsmotion.cpp
diff options
context:
space:
mode:
authorLoren Shih <seraph@lindenlab.com>2011-04-13 15:13:10 -0400
committerLoren Shih <seraph@lindenlab.com>2011-04-13 15:13:10 -0400
commit435117e8121f09bf43c80900fed13856a3a85825 (patch)
treeaf43cf7068ccfb4bc846117b13c6ffd69790eb74 /indra/newview/llphysicsmotion.cpp
parentaea35df23ea5d5af403721edffe32124890e6a2b (diff)
SH-1329 FIXED Physics are "twitchy" for high-FPS machines
Fixed bug that was messing up time slices for physics.
Diffstat (limited to 'indra/newview/llphysicsmotion.cpp')
-rw-r--r--indra/newview/llphysicsmotion.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/indra/newview/llphysicsmotion.cpp b/indra/newview/llphysicsmotion.cpp
index 67bb139a5e..4f6b155fa0 100644
--- a/indra/newview/llphysicsmotion.cpp
+++ b/indra/newview/llphysicsmotion.cpp
@@ -451,7 +451,14 @@ BOOL LLPhysicsMotion::onUpdate(F32 time)
//
const F32 time_delta = time - mLastTime;
- if (time_delta > 3.0 || time_delta <= 0.01)
+
+ // Don't update too frequently, to avoid precision errors from small time slices.
+ if (time_delta <= .01)
+ {
+ return FALSE;
+ }
+
+ if (time_delta > 3.0)
{
mLastTime = time;
return FALSE;