From cde5b233530c3b43134039e8d8d5589b2daa28bf Mon Sep 17 00:00:00 2001 From: Siana Gearz Date: Wed, 20 Nov 2013 02:22:16 +0100 Subject: [PATCH] Limit avatar physics to 20-40 simulation steps per second to avoid wonky integration --- indra/newview/llphysicsmotion.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/indra/newview/llphysicsmotion.cpp b/indra/newview/llphysicsmotion.cpp index 6fc0ab438..d681dbd69 100644 --- a/indra/newview/llphysicsmotion.cpp +++ b/indra/newview/llphysicsmotion.cpp @@ -45,7 +45,8 @@ typedef std::map controller_map_t; typedef std::map default_controller_map_t; #define MIN_REQUIRED_PIXEL_AREA_AVATAR_PHYSICS_MOTION 0.f -#define TIME_ITERATION_STEP 0.1f +#define TIME_ITERATION_STEP 0.05f +#define MINIMUM_UPDATE_TIMESTEP 0.025f inline F64 llsgn(const F64 a) { @@ -592,7 +593,7 @@ BOOL LLPhysicsMotion::onUpdate(F32 time) const F32 time_delta = time - mLastTime; // Don't update too frequently, to avoid precision errors from small time slices. - if (time_delta <= .01) + if (time_delta <= MINIMUM_UPDATE_TIMESTEP) { return FALSE; } @@ -889,4 +890,4 @@ void LLPhysicsMotion::reset() mCharacter->setVisualParamWeight((*iter).mParam,(*iter).mParam->getDefaultWeight()); } } -} \ No newline at end of file +}