diff options
author | Loren Shih <seraph@lindenlab.com> | 2011-04-13 15:13:10 -0400 |
---|---|---|
committer | Loren Shih <seraph@lindenlab.com> | 2011-04-13 15:13:10 -0400 |
commit | 21e37069fe723094bbf3b857acc5c1d494ecb942 (patch) | |
tree | 88f1f917ab51dfd23ee438cbd1e2a5b1b06bb0f6 /indra | |
parent | 4438a5ebb2faebc2a3a9de82668d14f870f50d84 (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')
-rw-r--r-- | indra/newview/llphysicsmotion.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/indra/newview/llphysicsmotion.cpp b/indra/newview/llphysicsmotion.cpp index 1d3c2b72f2..de4ce52351 100644 --- a/indra/newview/llphysicsmotion.cpp +++ b/indra/newview/llphysicsmotion.cpp @@ -452,7 +452,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;
|