From 3208104e2e51124fb6ee90133fee328f59e1fddc Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Tue, 29 Mar 2011 20:57:17 -0400 Subject: A bit of rearchitecture so that we can have edit wearables that don't have associated snapshots. Needed to support physics wearables, which don't use a snapshot. --- indra/newview/llphysicsmotion.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'indra/newview/llphysicsmotion.cpp') diff --git a/indra/newview/llphysicsmotion.cpp b/indra/newview/llphysicsmotion.cpp index 48e632280e..4048c66262 100644 --- a/indra/newview/llphysicsmotion.cpp +++ b/indra/newview/llphysicsmotion.cpp @@ -448,8 +448,16 @@ BOOL LLPhysicsMotion::onUpdate(F32 time) const F32 behavior_spring = getParamValue("Spring"); const F32 behavior_gain = getParamValue("Gain"); const F32 behavior_damping = getParamValue("Damping"); - const F32 behavior_maxspeed = getParamValue("MaxSpeed"); const F32 behavior_drag = getParamValue("Drag"); + const BOOL physics_test = gSavedSettings.getBOOL("AvatarPhysicsTest"); + + F32 behavior_maxspeed = getParamValue("MaxSpeed"); + if (physics_test) + behavior_maxspeed = 100.0f; + /* + if (behavior_maxspeed == 0) + return FALSE; + */ F32 position_current_local = mPosition_local; // Normalized [0,1] range @@ -526,9 +534,9 @@ BOOL LLPhysicsMotion::onUpdate(F32 time) -behavior_maxspeed, behavior_maxspeed); // Temporary debugging setting to cause all avatars to move, for profiling purposes. - if (gSavedSettings.getBOOL("AvatarPhysicsTest")) + if (physics_test) { - velocity_new_local = sin(time*4.0)*5.0; + velocity_new_local = sin(time*4.0); } // Calculate the new parameters, or remain unchanged if max speed is 0. const F32 position_new_local = (behavior_maxspeed != 0) ? -- cgit v1.2.3