summaryrefslogtreecommitdiff
path: root/indra/newview/llphysicsmotion.cpp
diff options
context:
space:
mode:
authorLoren Shih <seraph@lindenlab.com>2011-03-21 15:39:42 -0400
committerLoren Shih <seraph@lindenlab.com>2011-03-21 15:39:42 -0400
commit209110d1aa7ee369ccdf68641c3d7f9e558427de (patch)
treeaf9e5ab41453b8557e928868e052914beca1887e /indra/newview/llphysicsmotion.cpp
parent77ad0269aca9169dc41bee08ff860373d7715b8c (diff)
Velocity now gets zeroed out if the param is pushed beyond limits.
Rescaled the max speed param.
Diffstat (limited to 'indra/newview/llphysicsmotion.cpp')
-rw-r--r--indra/newview/llphysicsmotion.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/indra/newview/llphysicsmotion.cpp b/indra/newview/llphysicsmotion.cpp
index 2a88a4a2b5..48e632280e 100644
--- a/indra/newview/llphysicsmotion.cpp
+++ b/indra/newview/llphysicsmotion.cpp
@@ -523,7 +523,7 @@ BOOL LLPhysicsMotion::onUpdate(F32 time)
const F32 acceleration_new_local = force_net / behavior_mass;
F32 velocity_new_local = mVelocity_local + acceleration_new_local;
velocity_new_local = llclamp(velocity_new_local,
- -behavior_maxspeed*100.0f, behavior_maxspeed*100.0f);
+ -behavior_maxspeed, behavior_maxspeed);
// Temporary debugging setting to cause all avatars to move, for profiling purposes.
if (gSavedSettings.getBOOL("AvatarPhysicsTest"))
@@ -535,6 +535,12 @@ BOOL LLPhysicsMotion::onUpdate(F32 time)
(position_current_local + velocity_new_local*time_delta) :
position_user_local;
+ // Zero out the velocity if the param is being pushed beyond its limits.
+ if (position_new_local < 0 || position_new_local > 1)
+ {
+ velocity_new_local = 0;
+ }
+
const F32 position_new_local_clamped = llclamp(position_new_local,
0.0f,
1.0f);