From 8653ea93b2669a180beaedad8765bdeec385d501 Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Mon, 17 Dec 2012 13:51:39 -0800 Subject: BulletSim: apply friction to linear and angular motion before returning advanced motor value. This seems to be the problem with BulletSim vehicles turning too quickly. Also removed the configuration parameter that controlled the timestep scaling kludge for angular velocity that was added to research the question of quick turning. --- OpenSim/Region/Physics/BulletSPlugin/BSMotors.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/Physics/BulletSPlugin/BSMotors.cs') diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSMotors.cs b/OpenSim/Region/Physics/BulletSPlugin/BSMotors.cs index cf0a9dc..e0faf4e 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSMotors.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSMotors.cs @@ -134,8 +134,6 @@ public class BSVMotor : BSMotor Vector3 addAmount = (TargetValue - CurrentValue)/TimeScale * timeStep; CurrentValue += addAmount; - returnCurrent = CurrentValue; - // The desired value reduces to zero which also reduces the difference with current. // If the decay time is infinite, don't decay at all. float decayFactor = 0f; @@ -156,6 +154,8 @@ public class BSVMotor : BSMotor CurrentValue *= (Vector3.One - frictionFactor); } + returnCurrent = CurrentValue; + MDetailLog("{0}, BSVMotor.Step,nonZero,{1},origCurr={2},origTarget={3},timeStep={4},timeScale={5},addAmnt={6},targetDecay={7},decayFact={8},fricTS={9},frictFact={10}", BSScene.DetailLogZero, UseName, origCurrVal, origTarget, timeStep, TimeScale, addAmount, -- cgit v1.1