From 3825ee503ddab29cf408ae35f5a43bcc154353f2 Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Thu, 17 Mar 2011 17:36:01 -0400 Subject: Work in progress. Big code cleanup ported from TheShining/avatar-physics (defunct branch). Added butt and belly. --- indra/newview/CMakeLists.txt | 4 +- indra/newview/character/avatar_lad.xml | 76 ++++ indra/newview/llphysicsmotion.cpp | 559 +++++++++++++++++++++++++ indra/newview/llphysicsmotion.h | 124 ++++++ indra/newview/llpolymesh.cpp | 31 +- indra/newview/llpolymorph.cpp | 31 ++ indra/newview/llpolymorph.h | 1 + indra/newview/llvoavatar.cpp | 10 +- indra/newview/llvoavatar.h | 2 +- indra/newview/skins/default/xui/en/strings.xml | 1 + 10 files changed, 827 insertions(+), 12 deletions(-) create mode 100644 indra/newview/llphysicsmotion.cpp create mode 100644 indra/newview/llphysicsmotion.h diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 42c3297210..b7ed4fc0a4 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -96,7 +96,6 @@ set(viewer_SOURCE_FILES llbottomtray.cpp llbox.cpp llbreadcrumbview.cpp - llbreastmotion.cpp llbrowsernotification.cpp llbuycurrencyhtml.cpp llcallbacklist.cpp @@ -379,6 +378,7 @@ set(viewer_SOURCE_FILES llparcelselection.cpp llparticipantlist.cpp llpatchvertexarray.cpp + llphysicsmotion.cpp llplacesinventorybridge.cpp llplacesinventorypanel.cpp llpopupview.cpp @@ -636,7 +636,6 @@ set(viewer_HEADER_FILES llbottomtray.h llbox.h llbreadcrumbview.h - llbreastmotion.h llbuycurrencyhtml.h llcallbacklist.h llcallfloater.h @@ -914,6 +913,7 @@ set(viewer_HEADER_FILES llparcelselection.h llparticipantlist.h llpatchvertexarray.h + llphysicsmotion.h llplacesinventorybridge.h llplacesinventorypanel.h llpolymesh.h diff --git a/indra/newview/character/avatar_lad.xml b/indra/newview/character/avatar_lad.xml index 453ed1baf7..c4117da893 100644 --- a/indra/newview/character/avatar_lad.xml +++ b/indra/newview/character/avatar_lad.xml @@ -3794,6 +3794,23 @@ + + + + + + + + + + + + + + + + + + + + controller_map_t; + +#define MIN_REQUIRED_PIXEL_AREA_BREAST_MOTION 0.f; + +inline F64 llsgn(const F64 a) +{ + if (a >= 0) + return 1; + return -1; +} + +class LLPhysicsMotion +{ +public: + LLPhysicsMotion(const std::string ¶m_user_name, + const std::string ¶m_driven_name, + const std::string &joint_name, + LLCharacter *character, + const LLVector3 &motion_direction_vec, + const controller_map_t &controllers) : + mParamUserName(param_user_name), + mParamDrivenName(param_driven_name), + mJointName(joint_name), + mMotionDirectionVec(motion_direction_vec), + mParamUser(NULL), + mParamDriven(NULL), + + mParamControllers(controllers), + mCharacter(character), + mLastTime(0), + mPosition_local(0), + mVelocityJoint_local(0), + mPositionLastUpdate_local(0), + mPositionMin_local(0), + mPositionMax_local(0) + { + mJointState = new LLJointState; + } + + BOOL initialize(); + + ~LLPhysicsMotion() {} + + BOOL onUpdate(F32 time); + + LLPointer getJointState() + { + return mJointState; + } +protected: + F32 getParamValue(const std::string& controller_key) + { + const controller_map_t::const_iterator& entry = mParamControllers.find(controller_key); + if (entry == mParamControllers.end()) + { + return 1.0; + } + const std::string& param_name = (*entry).second.c_str(); + return mCharacter->getVisualParamWeight(param_name.c_str()); + } + + F32 toLocal(const LLVector3 &world); + F32 calculateVelocity_local(const F32 time_delta); + F32 calculateAcceleration_local(F32 velocity_local, + const F32 time_delta); + +private: + const std::string mParamDrivenName; + const std::string mParamUserName; + const LLVector3 mMotionDirectionVec; + const std::string mJointName; + + F32 mPosition_local; + F32 mVelocityJoint_local; // How fast the joint is moving + F32 mAccelerationJoint_local; // Acceleration on the joint + + F32 mVelocity_local; // How fast the param is moving + F32 mPositionLastUpdate_local; + F32 mPositionMin_local; + F32 mPositionMax_local; + LLVector3 mPosition_world; + + LLViewerVisualParam *mParamUser; + LLViewerVisualParam *mParamDriven; + const controller_map_t mParamControllers; + + LLPointer mJointState; + LLCharacter *mCharacter; + + F32 mLastTime; + +}; + + + +BOOL LLPhysicsMotion::initialize() +{ + if (!mJointState->setJoint(mCharacter->getJoint(mJointName.c_str()))) + return FALSE; + mJointState->setUsage(LLJointState::ROT); + + mParamUser = (LLViewerVisualParam*)mCharacter->getVisualParam(mParamUserName.c_str()); + mParamDriven = (LLViewerVisualParam*)mCharacter->getVisualParam(mParamDrivenName.c_str()); + if ((mParamUser == NULL) || + (mParamDriven == NULL)) + { + llinfos << "Failure reading in either of both of [ " << mParamUserName << " : " << mParamDrivenName << " ]" << llendl; + return FALSE; + } + mPositionMin_local = mParamDriven->getMinWeight(); + mPositionMax_local = mParamDriven->getMaxWeight(); + + return TRUE; +} + +LLPhysicsMotionController::LLPhysicsMotionController(const LLUUID &id) : + LLMotion(id), + mCharacter(NULL) +{ + mName = "breast_motion"; +} + +LLPhysicsMotionController::~LLPhysicsMotionController() +{ + for (motion_vec_t::iterator iter = mMotions.begin(); + iter != mMotions.end(); + ++iter) + { + delete (*iter); + } +} + +BOOL LLPhysicsMotionController::onActivate() +{ + return TRUE; +} + +void LLPhysicsMotionController::onDeactivate() +{ +} + +LLMotion::LLMotionInitStatus LLPhysicsMotionController::onInitialize(LLCharacter *character) +{ + mCharacter = character; + + mMotions.clear(); + + controller_map_t controllers_cleavage; + controllers_cleavage["Mass"] = "Breast_Physics_Mass"; + controllers_cleavage["Smoothing"] = "Breast_Physics_Smoothing"; + controllers_cleavage["Gravity"] = "Breast_Physics_Gravity"; + controllers_cleavage["Damping"] = "Breast_Physics_Side_Damping"; + controllers_cleavage["Drag"] = "Breast_Physics_Side_Drag"; + controllers_cleavage["MaxSpeed"] = "Breast_Physics_Side_Max_Velocity"; + controllers_cleavage["Spring"] = "Breast_Physics_Side_Spring"; + controllers_cleavage["Gain"] = "Breast_Physics_Side_Gain"; + + LLPhysicsMotion *cleavage_motion = new LLPhysicsMotion("Breast_Female_Cleavage_Driver", + "Breast_Female_Cleavage", + "mChest", + character, + LLVector3(-1,0,0), + controllers_cleavage); + if (!cleavage_motion->initialize()) + return STATUS_FAILURE; + addMotion(cleavage_motion); + + controller_map_t controllers_bounce; + controllers_bounce["Mass"] = "Breast_Physics_Mass"; + controllers_bounce["Smoothing"] = "Breast_Physics_Smoothing"; + controllers_bounce["Gravity"] = "Breast_Physics_Gravity"; + controllers_bounce["Damping"] = "Breast_Physics_UpDown_Damping"; + controllers_bounce["Drag"] = "Breast_Physics_UpDown_Drag"; + controllers_bounce["MaxSpeed"] = "Breast_Physics_UpDown_Max_Velocity"; + controllers_bounce["Spring"] = "Breast_Physics_UpDown_Spring"; + controllers_bounce["Gain"] = "Breast_Physics_UpDown_Gain"; + + LLPhysicsMotion *bounce_motion = new LLPhysicsMotion("Breast_Gravity_Driver", + "Breast_Gravity", + "mChest", + character, + LLVector3(0,0,1), + controllers_bounce); + if (!bounce_motion->initialize()) + return STATUS_FAILURE; + addMotion(bounce_motion); + + controller_map_t controllers_butt_bounce; + controllers_butt_bounce["Mass"] = "Breast_Physics_Mass"; + controllers_butt_bounce["Smoothing"] = "Breast_Physics_Smoothing"; + controllers_butt_bounce["Gravity"] = "Breast_Physics_Gravity"; + controllers_butt_bounce["Damping"] = "Breast_Physics_Side_Damping"; + controllers_butt_bounce["Drag"] = "Breast_Physics_Side_Drag"; + controllers_butt_bounce["MaxSpeed"] = "Breast_Physics_Side_Max_Velocity"; + controllers_butt_bounce["Spring"] = "Breast_Physics_Side_Spring"; + controllers_butt_bounce["Gain"] = "Breast_Physics_Side_Gain"; + + LLPhysicsMotion *butt_bounce_motion = new LLPhysicsMotion("Butt_Gravity_Driver", + "Butt_Gravity", + "mPelvis", + character, + LLVector3(0,0,-1), + controllers_butt_bounce); + if (!butt_bounce_motion->initialize()) + return STATUS_FAILURE; + addMotion(butt_bounce_motion); + + controller_map_t controllers_belly_bounce; + controllers_belly_bounce["Mass"] = "Breast_Physics_Mass"; + controllers_belly_bounce["Smoothing"] = "Breast_Physics_Smoothing"; + controllers_belly_bounce["Gravity"] = "Breast_Physics_Gravity"; + controllers_belly_bounce["Damping"] = "Breast_Physics_UpDown_Damping"; + controllers_belly_bounce["Drag"] = "Breast_Physics_UpDown_Drag"; + controllers_belly_bounce["MaxSpeed"] = "Breast_Physics_UpDown_Max_Velocity"; + controllers_belly_bounce["Spring"] = "Breast_Physics_UpDown_Spring"; + controllers_belly_bounce["Gain"] = "Breast_Physics_UpDown_Gain"; + + LLPhysicsMotion *belly_bounce_motion = new LLPhysicsMotion("Big_Belly_Torso", + "Belly Size", + "mChest", + character, + LLVector3(-0.005f,0,0), + controllers_belly_bounce); + if (!belly_bounce_motion->initialize()) + return STATUS_FAILURE; + addMotion(belly_bounce_motion); + + return STATUS_SUCCESS; +} + +void LLPhysicsMotionController::addMotion(LLPhysicsMotion *motion) +{ + addJointState(motion->getJointState()); + mMotions.push_back(motion); +} + +F32 LLPhysicsMotionController::getMinPixelArea() +{ + return MIN_REQUIRED_PIXEL_AREA_BREAST_MOTION; +} + +// Local space means "parameter space". +F32 LLPhysicsMotion::toLocal(const LLVector3 &world) +{ + LLJoint *joint = mJointState->getJoint(); + const LLQuaternion rotation_world = joint->getWorldRotation(); + + LLVector3 dir_world = mMotionDirectionVec * rotation_world; + dir_world.normalize(); + return world * dir_world * mMotionDirectionVec.length(); // dot product +} + +F32 LLPhysicsMotion::calculateVelocity_local(const F32 time_delta) +{ + LLJoint *joint = mJointState->getJoint(); + const LLVector3 position_world = joint->getWorldPosition(); + const LLQuaternion rotation_world = joint->getWorldRotation(); + const LLVector3 last_position_world = mPosition_world; + const LLVector3 velocity_world = (position_world-last_position_world) / time_delta; + const F32 velocity_local = toLocal(velocity_world); + return velocity_local; +} + +F32 LLPhysicsMotion::calculateAcceleration_local(const F32 velocity_local, + const F32 time_delta) +{ + const F32 smoothing = getParamValue("Smoothing"); + const F32 acceleration_local = velocity_local - mVelocityJoint_local; + + const F32 smoothed_acceleration_local = + acceleration_local * 1.0/smoothing + + mAccelerationJoint_local * (smoothing-1.0)/smoothing; + + return smoothed_acceleration_local; +} + +BOOL LLPhysicsMotionController::onUpdate(F32 time, U8* joint_mask) +{ + // Skip if disabled globally. + if (!gSavedSettings.getBOOL("AvatarPhysics")) + { + return TRUE; + } + + if (mCharacter->getSex() != SEX_FEMALE) return TRUE; + + BOOL update_visuals = FALSE; + for (motion_vec_t::iterator iter = mMotions.begin(); + iter != mMotions.end(); + ++iter) + { + LLPhysicsMotion *motion = (*iter); + update_visuals |= motion->onUpdate(time); + } + + if (update_visuals) + mCharacter->updateVisualParams(); + + return TRUE; +} + + +// Return TRUE if character has to update visual params. +BOOL LLPhysicsMotion::onUpdate(F32 time) +{ + // static FILE *mFileWrite = fopen("c:\\temp\\avatar_data.txt","w"); + + if (!mParamUser || !mParamDriven) + return FALSE; + + if (!mLastTime) + { + mLastTime = time; + return FALSE; + } + + //////////////////////////////////////////////////////////////////////////////// + // Get all parameters and settings + // + + const F32 time_delta = time - mLastTime; + if (time_delta > 3.0 || time_delta <= 0.01) + { + mLastTime = time; + return FALSE; + } + + // Higher LOD is better. This controls the granularity + // and frequency of updates for the motions. + const F32 lod_factor = LLVOAvatar::sPhysicsLODFactor; + if (lod_factor == 0) + { + return TRUE; + } + + F32 behavior_mass = getParamValue("Mass"); + F32 behavior_gravity = getParamValue("Gravity"); + F32 behavior_spring = getParamValue("Spring"); + F32 behavior_gain = getParamValue("Gain"); + F32 behavior_damping = getParamValue("Damping"); + F32 behavior_maxspeed = getParamValue("MaxSpeed"); + F32 behavior_drag = getParamValue("Drag"); + + F32 position_user_local = mParamUser->getWeight(); + F32 position_current_local = mPosition_local; + + // + // End parameters and settings + //////////////////////////////////////////////////////////////////////////////// + + + //////////////////////////////////////////////////////////////////////////////// + // Calculate velocity and acceleration in parameter space. + // + + const F32 velocity_joint_local = calculateVelocity_local(time_delta); + const F32 acceleration_joint_local = calculateAcceleration_local(velocity_joint_local, time_delta); + + LLJoint *joint = mJointState->getJoint(); + + // + // End velocity and acceleration + //////////////////////////////////////////////////////////////////////////////// + + + //////////////////////////////////////////////////////////////////////////////// + // Calculate the total force + // + + // Spring force is a restoring force towards the original user-set breast position. + // F = kx + const F32 spring_length = position_current_local - position_user_local; + const F32 force_spring = -spring_length * behavior_spring; + + // Acceleration is the force that comes from the change in velocity of the torso. + // F = ma + const F32 force_accel = behavior_gain * (acceleration_joint_local * behavior_mass); + + // Gravity always points downward in world space. + // F = mg + const LLVector3 gravity_world(0,0,1); + const F32 force_gravity = behavior_gain * (toLocal(gravity_world) * behavior_gravity * behavior_mass); + + // Damping is a restoring force that opposes the current velocity. + // F = -kv + const F32 force_damping = -behavior_damping * mVelocity_local; + + // Drag is a force imparted by velocity (intuitively it is similar to wind resistance) + // F = .5kv^2 + const F32 force_drag = .5*behavior_drag*velocity_joint_local*velocity_joint_local*llsgn(velocity_joint_local); + + const F32 force_net = (force_accel + + force_gravity + + force_spring + + force_damping + + force_drag); + + // + // End total force + //////////////////////////////////////////////////////////////////////////////// + + + //////////////////////////////////////////////////////////////////////////////// + // Calculate new params + // + + // Calculate the new acceleration based on the net force. + // a = F/m + 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); + + // Temporary debugging setting to cause all avatars to move, for profiling purposes. + if (gSavedSettings.getBOOL("AvatarPhysicsTest")) + { + velocity_new_local = sin(time*4.0)*5.0; + } + // Calculate the new parameters and clamp them to the min/max ranges. + F32 position_new_local = position_current_local + velocity_new_local*time_delta; + position_new_local = llclamp(position_new_local, + mPositionMin_local, mPositionMax_local); + + // Set the new parameters. + // If the param is disabled, just set the param to the user value. + if (behavior_maxspeed == 0) + { + position_new_local = position_user_local; + } + mCharacter->setVisualParamWeight(mParamDriven, + position_new_local, + FALSE); + + // + // End calculate new params + //////////////////////////////////////////////////////////////////////////////// + + //////////////////////////////////////////////////////////////////////////////// + // Conditionally update the visual params + // + + // Updating the visual params (i.e. what the user sees) is fairly expensive. + // So only update if the params have changed enough, and also take into account + // the graphics LOD settings. + + BOOL update_visuals = FALSE; + + // For non-self, if the avatar is small enough visually, then don't update. + const F32 area_for_max_settings = 0.0; + const F32 area_for_min_settings = 1400.0; + const F32 area_for_this_setting = area_for_max_settings + (area_for_min_settings-area_for_max_settings)*(1.0-lod_factor); + const F32 pixel_area = fsqrtf(mCharacter->getPixelArea()); + + const BOOL is_self = (dynamic_cast(mCharacter) != NULL); + if ((pixel_area > area_for_this_setting) || is_self) + { + // If the parameter hasn't changed enough, then don't update. + const F32 position_diff_local = llabs(mPositionLastUpdate_local-position_new_local); + const F32 min_delta = (1.0-lod_factor)*(mPositionMax_local-mPositionMin_local)/2.0; + if (llabs(position_diff_local) > min_delta) + { + update_visuals = TRUE; + mPositionLastUpdate_local = position_new_local; + } + } + + update_visuals = TRUE; + mPositionLastUpdate_local = position_new_local; + + // + // End update visual params + //////////////////////////////////////////////////////////////////////////////// + + mVelocityJoint_local = velocity_joint_local; + + mVelocity_local = velocity_new_local; + mAccelerationJoint_local = acceleration_joint_local; + mPosition_local = position_new_local; + + mPosition_world = joint->getWorldPosition(); + mLastTime = time; + + /* + if (mFileWrite != NULL && is_self) + { + fprintf(mFileWrite,"%f\t%f\t%f \t\t%f \t\t%f\t%f\t%f\t \t\t%f\t%f\t%f\t%f\t%f \t\t%f\t%f\t%f\n", + position_new_local, + velocity_new_local, + acceleration_new_local, + + time_delta, + + mPosition_world[0], + mPosition_world[1], + mPosition_world[2], + + force_net, + force_spring, + force_accel, + force_damping, + force_drag, + + spring_length, + velocity_joint_local, + acceleration_joint_local + ); + } + */ + + return update_visuals; +} + diff --git a/indra/newview/llphysicsmotion.h b/indra/newview/llphysicsmotion.h new file mode 100644 index 0000000000..0c0087d269 --- /dev/null +++ b/indra/newview/llphysicsmotion.h @@ -0,0 +1,124 @@ +/** + * @file llphysicsmotion.h + * @brief Implementation of LLPhysicsMotion class. + * + * $LicenseInfo:firstyear=2001&license=viewergpl$ + * + * Copyright (c) 2001-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#ifndef LL_LLPHYSICSMOTIONCONTROLLER_H +#define LL_LLPHYSICSMOTIONCONTROLLER_H + +//----------------------------------------------------------------------------- +// Header files +//----------------------------------------------------------------------------- +#include "llmotion.h" +#include "llframetimer.h" + +#define PHYSICS_MOTION_FADEIN_TIME 1.0f +#define PHYSICS_MOTION_FADEOUT_TIME 1.0f + +class LLPhysicsMotion; + +//----------------------------------------------------------------------------- +// class LLPhysicsMotion +//----------------------------------------------------------------------------- +class LLPhysicsMotionController : + public LLMotion +{ +public: + // Constructor + LLPhysicsMotionController(const LLUUID &id); + + // Destructor + virtual ~LLPhysicsMotionController(); + +public: + //------------------------------------------------------------------------- + // functions to support MotionController and MotionRegistry + //------------------------------------------------------------------------- + + // static constructor + // all subclasses must implement such a function and register it + static LLMotion *create(const LLUUID &id) { return new LLPhysicsMotionController(id); } + +public: + //------------------------------------------------------------------------- + // animation callbacks to be implemented by subclasses + //------------------------------------------------------------------------- + + // motions must specify whether or not they loop + virtual BOOL getLoop() { return TRUE; } + + // motions must report their total duration + virtual F32 getDuration() { return 0.0; } + + // motions must report their "ease in" duration + virtual F32 getEaseInDuration() { return PHYSICS_MOTION_FADEIN_TIME; } + + // motions must report their "ease out" duration. + virtual F32 getEaseOutDuration() { return PHYSICS_MOTION_FADEOUT_TIME; } + + // called to determine when a motion should be activated/deactivated based on avatar pixel coverage + virtual F32 getMinPixelArea(); + + // motions must report their priority + virtual LLJoint::JointPriority getPriority() { return LLJoint::MEDIUM_PRIORITY; } + + virtual LLMotionBlendType getBlendType() { return ADDITIVE_BLEND; } + + // run-time (post constructor) initialization, + // called after parameters have been set + // must return true to indicate success and be available for activation + virtual LLMotionInitStatus onInitialize(LLCharacter *character); + + // called when a motion is activated + // must return TRUE to indicate success, or else + // it will be deactivated + virtual BOOL onActivate(); + + // called per time step + // must return TRUE while it is active, and + // must return FALSE when the motion is completed. + virtual BOOL onUpdate(F32 time, U8* joint_mask); + + // called when a motion is deactivated + virtual void onDeactivate(); + + LLCharacter* getCharacter() { return mCharacter; } + +protected: + void addMotion(LLPhysicsMotion *motion); +private: + LLCharacter* mCharacter; + + typedef std::vector motion_vec_t; + motion_vec_t mMotions; +}; + +#endif // LL_LLPHYSICSMOTION_H + diff --git a/indra/newview/llpolymesh.cpp b/indra/newview/llpolymesh.cpp index 2942f4befb..4541fa71d5 100644 --- a/indra/newview/llpolymesh.cpp +++ b/indra/newview/llpolymesh.cpp @@ -602,12 +602,35 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName ) } mMorphData.insert(morph_data); - /* - if (std::string(morphName) == "Breast_Gravity") + + if (!strcmp(morphName, "Big_Belly_Torso")) + { + LLPolyMorphData* belly_data = new LLPolyMorphData(*morph_data); + belly_data->mName = std::string("Belly_Gravity"); + for (U32 v=0; v < belly_data->mNumIndices; v++) + { + // llinfos << "Coord: " << v << "\t" << belly_data->mCoords[v] << llendl; + belly_data->mCoords[v][0] = 0; + belly_data->mCoords[v][1] = 0; + belly_data->mCoords[v][2] = 0.01F; + } + mMorphData.insert(belly_data); + } + + if (!strcmp(morphName, "Small_Butt")) { - LLPolyMorphData *morph_data_clone = new LLPolyMorphData(std::string(morphName)); + llinfos << "Reading small butt" << llendl; + LLPolyMorphData* butt_data = new LLPolyMorphData(*morph_data); + butt_data->mName = std::string("Butt_Gravity"); + for (U32 v=0; v < butt_data->mNumIndices; v++) + { + // llinfos << "Coord: " << v << "\t" << butt_data->mCoords[v] << llendl; + butt_data->mCoords[v][0] = 0; + butt_data->mCoords[v][1] = 0; + butt_data->mCoords[v][2] = 0.01F; + } + mMorphData.insert(butt_data); } - */ } S32 numRemaps; diff --git a/indra/newview/llpolymorph.cpp b/indra/newview/llpolymorph.cpp index ec41ef08f5..5a67fd482a 100644 --- a/indra/newview/llpolymorph.cpp +++ b/indra/newview/llpolymorph.cpp @@ -59,6 +59,37 @@ LLPolyMorphData::LLPolyMorphData(const std::string& morph_name) mMesh = NULL; } +LLPolyMorphData::LLPolyMorphData(const LLPolyMorphData &rhs) : + mName(rhs.mName), + mNumIndices(rhs.mNumIndices), + mTotalDistortion(rhs.mTotalDistortion), + mAvgDistortion(rhs.mAvgDistortion), + mMaxDistortion(rhs.mMaxDistortion), + mVertexIndices(NULL), + mCoords(NULL), + mNormals(NULL), + mBinormals(NULL), + mTexCoords(NULL) +{ + const S32 numVertices = mNumIndices; + + mCoords = new LLVector3[numVertices]; + mNormals = new LLVector3[numVertices]; + mBinormals = new LLVector3[numVertices]; + mTexCoords = new LLVector2[numVertices]; + mVertexIndices = new U32[numVertices]; + + for (S32 v=0; v < numVertices; v++) + { + mCoords[v] = rhs.mCoords[v]; + mNormals[v] = rhs.mNormals[v]; + mBinormals[v] = rhs.mBinormals[v]; + mTexCoords[v] = rhs.mTexCoords[v]; + mVertexIndices[v] = rhs.mVertexIndices[v]; + } +} + + //----------------------------------------------------------------------------- // ~LLPolyMorphData() //----------------------------------------------------------------------------- diff --git a/indra/newview/llpolymorph.h b/indra/newview/llpolymorph.h index bc111882b7..8a024f2e9e 100644 --- a/indra/newview/llpolymorph.h +++ b/indra/newview/llpolymorph.h @@ -46,6 +46,7 @@ class LLPolyMorphData public: LLPolyMorphData(const std::string& morph_name); ~LLPolyMorphData(); + LLPolyMorphData(const LLPolyMorphData &rhs); BOOL loadBinary(LLFILE* fp, LLPolyMeshSharedData *mesh); const std::string& getName() { return mName; } diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 3476dc80e8..2c5e728c87 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -48,7 +48,7 @@ #include "llanimationstates.h" #include "llavatarnamecache.h" #include "llavatarpropertiesprocessor.h" -#include "llbreastmotion.h" +#include "llphysicsmotion.h" #include "llviewercontrol.h" #include "llcallingcard.h" // IDEVO for LLAvatarTracker #include "lldrawpoolavatar.h" @@ -126,7 +126,7 @@ const LLUUID ANIM_AGENT_HEAD_ROT = LLUUID("e6e8d1dd-e643-fff7-b238-c6b4b056a68d" const LLUUID ANIM_AGENT_PELVIS_FIX = LLUUID("0c5dd2a2-514d-8893-d44d-05beffad208b"); //"pelvis_fix" const LLUUID ANIM_AGENT_TARGET = LLUUID("0e4896cb-fba4-926c-f355-8720189d5b55"); //"target" const LLUUID ANIM_AGENT_WALK_ADJUST = LLUUID("829bc85b-02fc-ec41-be2e-74cc6dd7215d"); //"walk_adjust" -const LLUUID ANIM_AGENT_BREAST_MOTION = LLUUID("7360e029-3cb8-ebc4-863e-212df440d987"); //"breast_motion" +const LLUUID ANIM_AGENT_PHYSICS_MOTION = LLUUID("7360e029-3cb8-ebc4-863e-212df440d987"); //"physics_motion" //----------------------------------------------------------------------------- @@ -1149,7 +1149,7 @@ void LLVOAvatar::initClass() gAnimLibrary.animStateSetString(ANIM_AGENT_BODY_NOISE,"body_noise"); gAnimLibrary.animStateSetString(ANIM_AGENT_BREATHE_ROT,"breathe_rot"); - gAnimLibrary.animStateSetString(ANIM_AGENT_BREAST_MOTION,"breast_motion"); + gAnimLibrary.animStateSetString(ANIM_AGENT_PHYSICS_MOTION,"physics_motion"); gAnimLibrary.animStateSetString(ANIM_AGENT_EDITING,"editing"); gAnimLibrary.animStateSetString(ANIM_AGENT_EYE,"eye"); gAnimLibrary.animStateSetString(ANIM_AGENT_FLY_ADJUST,"fly_adjust"); @@ -1288,7 +1288,7 @@ void LLVOAvatar::initInstance(void) // motions without a start/stop bit registerMotion( ANIM_AGENT_BODY_NOISE, LLBodyNoiseMotion::create ); registerMotion( ANIM_AGENT_BREATHE_ROT, LLBreatheMotionRot::create ); - registerMotion( ANIM_AGENT_BREAST_MOTION, LLBreastMotion::create ); + registerMotion( ANIM_AGENT_PHYSICS_MOTION, LLPhysicsMotionController::create ); registerMotion( ANIM_AGENT_EDITING, LLEditingMotion::create ); registerMotion( ANIM_AGENT_EYE, LLEyeMotion::create ); registerMotion( ANIM_AGENT_FEMALE_WALK, LLKeyframeWalkMotion::create ); @@ -1702,7 +1702,7 @@ void LLVOAvatar::startDefaultMotions() startMotion( ANIM_AGENT_EYE ); startMotion( ANIM_AGENT_BODY_NOISE ); startMotion( ANIM_AGENT_BREATHE_ROT ); - startMotion( ANIM_AGENT_BREAST_MOTION ); + startMotion( ANIM_AGENT_PHYSICS_MOTION ); startMotion( ANIM_AGENT_HAND_MOTION ); startMotion( ANIM_AGENT_PELVIS_FIX ); diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index f5f90b2912..3659fb055f 100644 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -50,7 +50,7 @@ extern const LLUUID ANIM_AGENT_BODY_NOISE; extern const LLUUID ANIM_AGENT_BREATHE_ROT; -extern const LLUUID ANIM_AGENT_BREAST_MOTION; +extern const LLUUID ANIM_AGENT_PHYSICS_MOTION; extern const LLUUID ANIM_AGENT_EDITING; extern const LLUUID ANIM_AGENT_EYE; extern const LLUUID ANIM_AGENT_FLY_ADJUST; diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index 30de6d14c6..3c7d7d1777 100644 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -2530,6 +2530,7 @@ If you continue to receive this message, contact the [SUPPORT_SITE]. Bushy Eyebrows Bushy Hair Butt Size +Butt Gravity Bustle Skirt No Bustle More Bustle -- cgit v1.2.3 From c754a7c0000d6f1defd58d7e8b4587d46ee1defe Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Fri, 18 Mar 2011 10:16:03 -0400 Subject: Enabling for belly vertical motion. --- indra/newview/character/avatar_lad.xml | 80 ++++++++++++++++++++++++---------- indra/newview/llphysicsmotion.cpp | 4 +- indra/newview/llpolymesh.cpp | 31 +++++++++++-- 3 files changed, 85 insertions(+), 30 deletions(-) diff --git a/indra/newview/character/avatar_lad.xml b/indra/newview/character/avatar_lad.xml index c4117da893..6dbda4fd16 100644 --- a/indra/newview/character/avatar_lad.xml +++ b/indra/newview/character/avatar_lad.xml @@ -3795,10 +3795,10 @@ + + + + + + + + + - - - - - - + + + + + + + + + + initialize()) return STATUS_FAILURE; diff --git a/indra/newview/llpolymesh.cpp b/indra/newview/llpolymesh.cpp index 4541fa71d5..08813e6a98 100644 --- a/indra/newview/llpolymesh.cpp +++ b/indra/newview/llpolymesh.cpp @@ -606,10 +606,35 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName ) if (!strcmp(morphName, "Big_Belly_Torso")) { LLPolyMorphData* belly_data = new LLPolyMorphData(*morph_data); - belly_data->mName = std::string("Belly_Gravity"); + belly_data->mName = std::string("Big_Belly_Torso_Gravity"); + for (U32 v=0; v < belly_data->mNumIndices; v++) + { + belly_data->mCoords[v][0] = 0; + belly_data->mCoords[v][1] = 0; + belly_data->mCoords[v][2] = 0.01F; + } + mMorphData.insert(belly_data); + } + + if (!strcmp(morphName, "Big_Belly_Legs")) + { + LLPolyMorphData* belly_data = new LLPolyMorphData(*morph_data); + belly_data->mName = std::string("Big_Belly_Legs_Gravity"); + for (U32 v=0; v < belly_data->mNumIndices; v++) + { + belly_data->mCoords[v][0] = 0; + belly_data->mCoords[v][1] = 0; + belly_data->mCoords[v][2] = 0.01F; + } + mMorphData.insert(belly_data); + } + + if (!strcmp(morphName, "skirt_belly")) + { + LLPolyMorphData* belly_data = new LLPolyMorphData(*morph_data); + belly_data->mName = std::string("skirt_belly_gravity"); for (U32 v=0; v < belly_data->mNumIndices; v++) { - // llinfos << "Coord: " << v << "\t" << belly_data->mCoords[v] << llendl; belly_data->mCoords[v][0] = 0; belly_data->mCoords[v][1] = 0; belly_data->mCoords[v][2] = 0.01F; @@ -619,12 +644,10 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName ) if (!strcmp(morphName, "Small_Butt")) { - llinfos << "Reading small butt" << llendl; LLPolyMorphData* butt_data = new LLPolyMorphData(*morph_data); butt_data->mName = std::string("Butt_Gravity"); for (U32 v=0; v < butt_data->mNumIndices; v++) { - // llinfos << "Coord: " << v << "\t" << butt_data->mCoords[v] << llendl; butt_data->mCoords[v][0] = 0; butt_data->mCoords[v][1] = 0; butt_data->mCoords[v][2] = 0.01F; -- cgit v1.2.3 From 9560faa1496790334becbe819b6ced6f5b17cf97 Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Fri, 18 Mar 2011 10:31:38 -0400 Subject: Comments. --- indra/newview/llphysicsmotion.cpp | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/indra/newview/llphysicsmotion.cpp b/indra/newview/llphysicsmotion.cpp index 5de1f7e145..01b3ebe1f0 100644 --- a/indra/newview/llphysicsmotion.cpp +++ b/indra/newview/llphysicsmotion.cpp @@ -59,7 +59,30 @@ inline F64 llsgn(const F64 a) class LLPhysicsMotion { public: - LLPhysicsMotion(const std::string ¶m_user_name, + /* + param_user_name: The param (if any) that the user sees and controls. This is what + the particular body part would look like without physics. For example, it may be + the breast gravity. This param's value should will not be altered, and is only + used as a reference point for the rest position of the body party. This is usually + a driver param and the param that physics is altering is the driven param. + If this is left blank, that means that the physics is affecting a param that is + not exposed to the user. + + param_driven_name: The param whose value is actually set by the physics. + + joint_name: The joint that the body part is attached to. The joint is + used to determine the orientation (rotation) of the body part. + + character: The avatar that this physics affects. + + motion_direction_vec: The direction (in world coordinates) that determines the + motion. For example, (0,0,1) is up-down, and means that up-down motion is what + determines how this joint moves. + + controllers: The various settings (e.g. spring force, mass) that determine how + the body part behaves. + */ + LLPhysicsMotion(const std::string ¶m_user_name, const std::string ¶m_driven_name, const std::string &joint_name, LLCharacter *character, -- cgit v1.2.3 From d55f816fb15eab67abb72997b2eb589fff16f4ee Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Fri, 18 Mar 2011 14:54:30 -0400 Subject: Some code cleanup. Changed equations to occur in normalized (0,1) space instead of parameter space. --- indra/newview/character/avatar_lad.xml | 42 +++---- indra/newview/lldriverparam.h | 2 + indra/newview/llphysicsmotion.cpp | 199 +++++++++++++++++++++------------ 3 files changed, 153 insertions(+), 90 deletions(-) diff --git a/indra/newview/character/avatar_lad.xml b/indra/newview/character/avatar_lad.xml index 6dbda4fd16..0fc62ccaf1 100644 --- a/indra/newview/character/avatar_lad.xml +++ b/indra/newview/character/avatar_lad.xml @@ -9142,9 +9142,9 @@ render_pass="bump"> edit_group="physics" label_min="Less" label_max="More" - value_default="2" - value_min="1" - value_max="5" + value_default=".2" + value_min=".1" + value_max=".5" camera_elevation=".3" camera_distance=".8"> @@ -9180,7 +9180,7 @@ render_pass="bump"> label_max="More" value_default="0" value_min="0" - value_max="1" + value_max="100" camera_elevation=".3" camera_distance=".8"> @@ -9215,7 +9215,7 @@ render_pass="bump"> label_min="Less" label_max="More" value_default="10" - value_min="1" + value_min="0" value_max="100" camera_elevation=".3" camera_distance=".8"> @@ -9232,9 +9232,9 @@ render_pass="bump"> edit_group="physics" label_min="Less" label_max="More" - value_default=".5" + value_default=".05" value_min="0" - value_max="1" + value_max=".1" camera_elevation=".3" camera_distance=".8"> @@ -9250,9 +9250,9 @@ render_pass="bump"> edit_group="physics" label_min="Less" label_max="More" - value_default=".1" + value_default=".15" value_min="0" - value_max="1" + value_max=".5" camera_elevation=".3" camera_distance=".8"> @@ -9268,7 +9268,7 @@ render_pass="bump"> edit_group="physics" label_min="Less" label_max="More" - value_default="0" + value_default="10" value_min="0" value_max="10" camera_elevation=".3" @@ -9287,9 +9287,9 @@ render_pass="bump"> edit_group="physics" label_min="Less" label_max="More" - value_default="1.5" + value_default=".1" value_min="0" - value_max="10" + value_max="1" camera_elevation=".3" camera_distance=".8"> @@ -9305,8 +9305,8 @@ render_pass="bump"> edit_group="physics" label_min="Less" label_max="More" - value_default="50" - value_min="1" + value_default="10" + value_min="0" value_max="100" camera_elevation=".3" camera_distance=".8"> @@ -9323,9 +9323,9 @@ render_pass="bump"> edit_group="physics" label_min="Less" label_max="More" - value_default=".1" + value_default=".05" value_min="0" - value_max="1" + value_max=".1" camera_elevation=".3" camera_distance=".8"> @@ -9341,9 +9341,9 @@ render_pass="bump"> edit_group="physics" label_min="Less" label_max="More" - value_default=".1" + value_default=".15" value_min="0" - value_max="1" + value_max=".5" camera_elevation=".3" camera_distance=".8"> @@ -9359,7 +9359,7 @@ render_pass="bump"> edit_group="physics" label_min="Less" label_max="More" - value_default="1" + value_default="10" value_min="0" value_max="10" camera_elevation=".3" @@ -9378,7 +9378,7 @@ render_pass="bump"> edit_group_order="7" label_min="Less" label_max="More" - value_default="10" + value_default="0" value_min="-1.5" value_max="2" camera_elevation=".3" @@ -9400,7 +9400,7 @@ render_pass="bump"> edit_group_order="8" label_min="Less" label_max="More" - value_default="10" + value_default="0" value_min="-.3" value_max="1.3" camera_elevation=".3" diff --git a/indra/newview/lldriverparam.h b/indra/newview/lldriverparam.h index a0e45cf5e5..fb1b44458c 100644 --- a/indra/newview/lldriverparam.h +++ b/indra/newview/lldriverparam.h @@ -30,6 +30,7 @@ #include "llviewervisualparam.h" #include "llwearabletype.h" +class LLPhysicsMotion; class LLVOAvatar; class LLWearable; @@ -76,6 +77,7 @@ protected: class LLDriverParam : public LLViewerVisualParam { + friend class LLPhysicsMotion; // physics motion needs to access driven params directly. public: LLDriverParam(LLVOAvatar *avatarp); LLDriverParam(LLWearable *wearablep); diff --git a/indra/newview/llphysicsmotion.cpp b/indra/newview/llphysicsmotion.cpp index 01b3ebe1f0..eb128e043c 100644 --- a/indra/newview/llphysicsmotion.cpp +++ b/indra/newview/llphysicsmotion.cpp @@ -46,6 +46,7 @@ #include "llvoavatarself.h" typedef std::map controller_map_t; +typedef std::map default_controller_map_t; #define MIN_REQUIRED_PIXEL_AREA_BREAST_MOTION 0.f; @@ -56,19 +57,30 @@ inline F64 llsgn(const F64 a) return -1; } +/* + At a high level, this works by setting temporary parameters that are not stored + in the avatar's list of params, and are not conveyed to other users. We accomplish + this by creating some new temporary driven params inside avatar_lad that are then driven + by the actual params that the user sees and sets. For example, in the old system, + the user sets a param called breast bouyancy, which controls the Z value of the breasts. + In our new system, the user still sets the breast bouyancy, but that param is redefined + as a driver param so that it affects ... +*/ + class LLPhysicsMotion { public: /* param_user_name: The param (if any) that the user sees and controls. This is what - the particular body part would look like without physics. For example, it may be + the particular property would look like without physics. For example, it may be the breast gravity. This param's value should will not be altered, and is only used as a reference point for the rest position of the body party. This is usually - a driver param and the param that physics is altering is the driven param. - If this is left blank, that means that the physics is affecting a param that is - not exposed to the user. + a driver param and the param(s) that physics is altering are the driven params. - param_driven_name: The param whose value is actually set by the physics. + param_driven_name: The param whose value is actually set by the physics. If you + leave this blank (which should suffice normally), the physics will assume that + param_user_name is a driver param and will set the params that the driver is + in charge of (i.e. the "driven" params). joint_name: The joint that the body part is attached to. The joint is used to determine the orientation (rotation) of the body part. @@ -100,9 +112,7 @@ public: mLastTime(0), mPosition_local(0), mVelocityJoint_local(0), - mPositionLastUpdate_local(0), - mPositionMin_local(0), - mPositionMax_local(0) + mPositionLastUpdate_local(0) { mJointState = new LLJointState; } @@ -123,17 +133,18 @@ protected: const controller_map_t::const_iterator& entry = mParamControllers.find(controller_key); if (entry == mParamControllers.end()) { - return 1.0; + return sDefaultController[controller_key]; } const std::string& param_name = (*entry).second.c_str(); return mCharacter->getVisualParamWeight(param_name.c_str()); } + void setParamValue(LLViewerVisualParam *param, + const F32 new_value_local); F32 toLocal(const LLVector3 &world); F32 calculateVelocity_local(const F32 time_delta); F32 calculateAcceleration_local(F32 velocity_local, const F32 time_delta); - private: const std::string mParamDrivenName; const std::string mParamUserName; @@ -146,8 +157,6 @@ private: F32 mVelocity_local; // How fast the param is moving F32 mPositionLastUpdate_local; - F32 mPositionMin_local; - F32 mPositionMax_local; LLVector3 mPosition_world; LLViewerVisualParam *mParamUser; @@ -158,10 +167,25 @@ private: LLCharacter *mCharacter; F32 mLastTime; - + + static default_controller_map_t sDefaultController; }; +default_controller_map_t initDefaultController() +{ + default_controller_map_t controller; + controller["Mass"] = 2.0f; + controller["Smoothing"] = 2.0f; + controller["Gravity"] = 0.0f; + controller["Damping"] = .5f; + controller["Drag"] = 0.1f; + controller["MaxSpeed"] = 10.0f; + controller["Spring"] = 1.0f; + controller["Gain"] = 10.0f; + return controller; +} +default_controller_map_t LLPhysicsMotion::sDefaultController = initDefaultController(); BOOL LLPhysicsMotion::initialize() { @@ -170,15 +194,13 @@ BOOL LLPhysicsMotion::initialize() mJointState->setUsage(LLJointState::ROT); mParamUser = (LLViewerVisualParam*)mCharacter->getVisualParam(mParamUserName.c_str()); - mParamDriven = (LLViewerVisualParam*)mCharacter->getVisualParam(mParamDrivenName.c_str()); - if ((mParamUser == NULL) || - (mParamDriven == NULL)) + if (mParamDrivenName != "") + mParamDriven = (LLViewerVisualParam*)mCharacter->getVisualParam(mParamDrivenName.c_str()); + if (mParamUser == NULL) { - llinfos << "Failure reading in either of both of [ " << mParamUserName << " : " << mParamDrivenName << " ]" << llendl; + llinfos << "Failure reading in [ " << mParamUserName << " ]" << llendl; return FALSE; } - mPositionMin_local = mParamDriven->getMinWeight(); - mPositionMax_local = mParamDriven->getMaxWeight(); return TRUE; } @@ -226,7 +248,7 @@ LLMotion::LLMotionInitStatus LLPhysicsMotionController::onInitialize(LLCharacter controllers_cleavage["Gain"] = "Breast_Physics_Side_Gain"; LLPhysicsMotion *cleavage_motion = new LLPhysicsMotion("Breast_Female_Cleavage_Driver", - "Breast_Female_Cleavage", + "", "mChest", character, LLVector3(-1,0,0), @@ -246,7 +268,7 @@ LLMotion::LLMotionInitStatus LLPhysicsMotionController::onInitialize(LLCharacter controllers_bounce["Gain"] = "Breast_Physics_UpDown_Gain"; LLPhysicsMotion *bounce_motion = new LLPhysicsMotion("Breast_Gravity_Driver", - "Breast_Gravity", + "", "mChest", character, LLVector3(0,0,1), @@ -259,14 +281,13 @@ LLMotion::LLMotionInitStatus LLPhysicsMotionController::onInitialize(LLCharacter controllers_butt_bounce["Mass"] = "Breast_Physics_Mass"; controllers_butt_bounce["Smoothing"] = "Breast_Physics_Smoothing"; controllers_butt_bounce["Gravity"] = "Breast_Physics_Gravity"; - controllers_butt_bounce["Damping"] = "Breast_Physics_Side_Damping"; - controllers_butt_bounce["Drag"] = "Breast_Physics_Side_Drag"; - controllers_butt_bounce["MaxSpeed"] = "Breast_Physics_Side_Max_Velocity"; - controllers_butt_bounce["Spring"] = "Breast_Physics_Side_Spring"; - controllers_butt_bounce["Gain"] = "Breast_Physics_Side_Gain"; - + controllers_butt_bounce["Damping"] = "Breast_Physics_UpDown_Damping"; + controllers_butt_bounce["Drag"] = "Breast_Physics_UpDown_Drag"; + controllers_butt_bounce["MaxSpeed"] = "Breast_Physics_UpDown_Max_Velocity"; + controllers_butt_bounce["Spring"] = "Breast_Physics_UpDown_Spring"; + controllers_butt_bounce["Gain"] = "Breast_Physics_UpDown_Gain"; LLPhysicsMotion *butt_bounce_motion = new LLPhysicsMotion("Butt_Gravity_Driver", - "Butt_Gravity", + "", "mPelvis", character, LLVector3(0,0,-1), @@ -284,13 +305,12 @@ LLMotion::LLMotionInitStatus LLPhysicsMotionController::onInitialize(LLCharacter controllers_belly_bounce["MaxSpeed"] = "Breast_Physics_UpDown_Max_Velocity"; controllers_belly_bounce["Spring"] = "Breast_Physics_UpDown_Spring"; controllers_belly_bounce["Gain"] = "Breast_Physics_UpDown_Gain"; - - LLPhysicsMotion *belly_bounce_motion = new LLPhysicsMotion("Big_Belly_Torso", - "Belly_Gravity", - "mChest", - character, - LLVector3(0,0,.25f), - controllers_belly_bounce); + LLPhysicsMotion *belly_bounce_motion = new LLPhysicsMotion("Belly_Gravity", + "", + "mChest", + character, + LLVector3(0,0,1), + controllers_belly_bounce); if (!belly_bounce_motion->initialize()) return STATUS_FAILURE; addMotion(belly_bounce_motion); @@ -375,7 +395,7 @@ BOOL LLPhysicsMotion::onUpdate(F32 time) { // static FILE *mFileWrite = fopen("c:\\temp\\avatar_data.txt","w"); - if (!mParamUser || !mParamDriven) + if (!mParamUser) return FALSE; if (!mLastTime) @@ -403,16 +423,24 @@ BOOL LLPhysicsMotion::onUpdate(F32 time) return TRUE; } - F32 behavior_mass = getParamValue("Mass"); - F32 behavior_gravity = getParamValue("Gravity"); - F32 behavior_spring = getParamValue("Spring"); - F32 behavior_gain = getParamValue("Gain"); - F32 behavior_damping = getParamValue("Damping"); - F32 behavior_maxspeed = getParamValue("MaxSpeed"); - F32 behavior_drag = getParamValue("Drag"); + LLJoint *joint = mJointState->getJoint(); + + const F32 behavior_mass = getParamValue("Mass"); + const F32 behavior_gravity = getParamValue("Gravity"); + 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"); + + F32 position_current_local = mPosition_local; // Normalized [0,1] range + // Normalize the param position to be from [0,1]. + // We have to use normalized values because there may be more than one driven param, + // and each of these driven params may have its own range. + // This means we'll do all our calculations in normalized [0,1] local coordinates. F32 position_user_local = mParamUser->getWeight(); - F32 position_current_local = mPosition_local; + position_user_local = (position_user_local - mParamUser->getMinWeight()) / (mParamUser->getMaxWeight() - mParamUser->getMinWeight()); // // End parameters and settings @@ -426,8 +454,6 @@ BOOL LLPhysicsMotion::onUpdate(F32 time) const F32 velocity_joint_local = calculateVelocity_local(time_delta); const F32 acceleration_joint_local = calculateAcceleration_local(velocity_joint_local, time_delta); - LLJoint *joint = mJointState->getJoint(); - // // End velocity and acceleration //////////////////////////////////////////////////////////////////////////////// @@ -486,21 +512,46 @@ BOOL LLPhysicsMotion::onUpdate(F32 time) { velocity_new_local = sin(time*4.0)*5.0; } - // Calculate the new parameters and clamp them to the min/max ranges. - F32 position_new_local = position_current_local + velocity_new_local*time_delta; - position_new_local = llclamp(position_new_local, - mPositionMin_local, mPositionMax_local); - - // Set the new parameters. - // If the param is disabled, just set the param to the user value. - if (behavior_maxspeed == 0) + // Calculate the new parameters, or remain unchanged if max speed is 0. + const F32 position_new_local = (behavior_maxspeed != 0) ? + (position_current_local + velocity_new_local*time_delta) : + position_user_local; + + const F32 position_new_local_clamped = llclamp(position_new_local, + 0.0f, + 1.0f); + + // Set the new param. + // 1. If the user has specified a param target, use that. + // 2. If the param is a driver param, set the param(s) that it drives. + // 3. Otherwise, set the param directly (don't do this if the param is a user-editable param!) + // If a specific param has been declared, then set that one. + // Otherwise, assume that the param is a driver param, and + // set the params that it drives. + if (mParamDriven) { - position_new_local = position_user_local; + setParamValue(mParamDriven,position_new_local_clamped); } - mCharacter->setVisualParamWeight(mParamDriven, - position_new_local, - FALSE); - + else + { + LLDriverParam *driver_param = dynamic_cast(mParamUser); + if (driver_param) + { + for (LLDriverParam::entry_list_t::iterator iter = driver_param->mDriven.begin(); + iter != driver_param->mDriven.end(); + ++iter) + { + LLDrivenEntry &entry = (*iter); + LLViewerVisualParam *driven_param = entry.mParam; + setParamValue(driven_param,position_new_local_clamped); + } + } + else + { + setParamValue(mParamUser,position_new_local_clamped); + } + } + // // End calculate new params //////////////////////////////////////////////////////////////////////////////// @@ -508,7 +559,7 @@ BOOL LLPhysicsMotion::onUpdate(F32 time) //////////////////////////////////////////////////////////////////////////////// // Conditionally update the visual params // - + // Updating the visual params (i.e. what the user sees) is fairly expensive. // So only update if the params have changed enough, and also take into account // the graphics LOD settings. @@ -520,13 +571,12 @@ BOOL LLPhysicsMotion::onUpdate(F32 time) const F32 area_for_min_settings = 1400.0; const F32 area_for_this_setting = area_for_max_settings + (area_for_min_settings-area_for_max_settings)*(1.0-lod_factor); const F32 pixel_area = fsqrtf(mCharacter->getPixelArea()); - + const BOOL is_self = (dynamic_cast(mCharacter) != NULL); if ((pixel_area > area_for_this_setting) || is_self) { - // If the parameter hasn't changed enough, then don't update. - const F32 position_diff_local = llabs(mPositionLastUpdate_local-position_new_local); - const F32 min_delta = (1.0-lod_factor)*(mPositionMax_local-mPositionMin_local)/2.0; + const F32 position_diff_local = llabs(mPositionLastUpdate_local-position_new_local_clamped); + const F32 min_delta = (1.0f-lod_factor)*4.0f; // Magic number 2.0f, can change this if experimentally something works better. if (llabs(position_diff_local) > min_delta) { update_visuals = TRUE; @@ -534,9 +584,6 @@ BOOL LLPhysicsMotion::onUpdate(F32 time) } } - update_visuals = TRUE; - mPositionLastUpdate_local = position_new_local; - // // End update visual params //////////////////////////////////////////////////////////////////////////////// @@ -551,6 +598,7 @@ BOOL LLPhysicsMotion::onUpdate(F32 time) mLastTime = time; /* + // Write out debugging info into a spreadsheet. if (mFileWrite != NULL && is_self) { fprintf(mFileWrite,"%f\t%f\t%f \t\t%f \t\t%f\t%f\t%f\t \t\t%f\t%f\t%f\t%f\t%f \t\t%f\t%f\t%f\n", @@ -577,6 +625,19 @@ BOOL LLPhysicsMotion::onUpdate(F32 time) } */ - return update_visuals; + return TRUE; +} + +// Range of new_value_local is assumed to be [0 , 1] normalized. +void LLPhysicsMotion::setParamValue(LLViewerVisualParam *param, + F32 new_value_normalized) +{ + const F32 value_min_local = param->getMinWeight(); + const F32 value_max_local = param->getMaxWeight(); + + const F32 new_value_local = value_min_local + (value_max_local-value_min_local) * new_value_normalized; + + mCharacter->setVisualParamWeight(param, + new_value_local, + FALSE); } - -- cgit v1.2.3 From 86613fd388d7985abc814ee8ee52da54fd74779e Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Fri, 18 Mar 2011 16:04:28 -0400 Subject: Variety of fixes for param ranges. Turned off normal/binormal effects for morphing. Fixed issue where updates were always being sent even if below the change threshold. --- indra/newview/character/avatar_lad.xml | 18 +++++----- indra/newview/llphysicsmotion.cpp | 6 ++-- indra/newview/llpolymesh.cpp | 64 +++++++++++++++++++--------------- 3 files changed, 48 insertions(+), 40 deletions(-) diff --git a/indra/newview/character/avatar_lad.xml b/indra/newview/character/avatar_lad.xml index 0fc62ccaf1..727a9e7fc4 100644 --- a/indra/newview/character/avatar_lad.xml +++ b/indra/newview/character/avatar_lad.xml @@ -9180,7 +9180,7 @@ render_pass="bump"> label_max="More" value_default="0" value_min="0" - value_max="100" + value_max="1" camera_elevation=".3" camera_distance=".8"> @@ -9196,9 +9196,9 @@ render_pass="bump"> edit_group="physics" label_min="Less" label_max="More" - value_default="3" + value_default=".1" value_min="0" - value_max="10" + value_max="1" camera_elevation=".3" camera_distance=".8"> @@ -9215,7 +9215,7 @@ render_pass="bump"> label_min="Less" label_max="More" value_default="10" - value_min="0" + value_min="1" value_max="100" camera_elevation=".3" camera_distance=".8"> @@ -9268,9 +9268,9 @@ render_pass="bump"> edit_group="physics" label_min="Less" label_max="More" - value_default="10" + value_default=".1" value_min="0" - value_max="10" + value_max=".1" camera_elevation=".3" camera_distance=".8"> @@ -9306,7 +9306,7 @@ render_pass="bump"> label_min="Less" label_max="More" value_default="10" - value_min="0" + value_min="1" value_max="100" camera_elevation=".3" camera_distance=".8"> @@ -9359,9 +9359,9 @@ render_pass="bump"> edit_group="physics" label_min="Less" label_max="More" - value_default="10" + value_default=".1" value_min="0" - value_max="10" + value_max=".1" camera_elevation=".3" camera_distance=".8"> diff --git a/indra/newview/llphysicsmotion.cpp b/indra/newview/llphysicsmotion.cpp index eb128e043c..c9a75784e1 100644 --- a/indra/newview/llphysicsmotion.cpp +++ b/indra/newview/llphysicsmotion.cpp @@ -309,7 +309,7 @@ LLMotion::LLMotionInitStatus LLPhysicsMotionController::onInitialize(LLCharacter "", "mChest", character, - LLVector3(0,0,1), + LLVector3(0,0,-1), controllers_belly_bounce); if (!belly_bounce_motion->initialize()) return STATUS_FAILURE; @@ -337,7 +337,7 @@ F32 LLPhysicsMotion::toLocal(const LLVector3 &world) LLVector3 dir_world = mMotionDirectionVec * rotation_world; dir_world.normalize(); - return world * dir_world * mMotionDirectionVec.length(); // dot product + return world * dir_world; } F32 LLPhysicsMotion::calculateVelocity_local(const F32 time_delta) @@ -625,7 +625,7 @@ BOOL LLPhysicsMotion::onUpdate(F32 time) } */ - return TRUE; + return update_visuals; } // Range of new_value_local is assumed to be [0 , 1] normalized. diff --git a/indra/newview/llpolymesh.cpp b/indra/newview/llpolymesh.cpp index 08813e6a98..4118401a4c 100644 --- a/indra/newview/llpolymesh.cpp +++ b/indra/newview/llpolymesh.cpp @@ -605,54 +605,62 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName ) if (!strcmp(morphName, "Big_Belly_Torso")) { - LLPolyMorphData* belly_data = new LLPolyMorphData(*morph_data); - belly_data->mName = std::string("Big_Belly_Torso_Gravity"); - for (U32 v=0; v < belly_data->mNumIndices; v++) + LLPolyMorphData* cloned_morph_data = new LLPolyMorphData(*morph_data); + cloned_morph_data->mName = std::string("Big_Belly_Torso_Gravity"); + for (U32 v=0; v < morph_data->mNumIndices; v++) { - belly_data->mCoords[v][0] = 0; - belly_data->mCoords[v][1] = 0; - belly_data->mCoords[v][2] = 0.01F; + cloned_morph_data->mCoords[v][0] = 0; + cloned_morph_data->mCoords[v][1] = 0; + cloned_morph_data->mCoords[v][2] = 0.01F; + cloned_morph_data->mNormals[v] = LLVector3(0,0,0); + cloned_morph_data->mBinormals[v] = LLVector3(0,0,0); } - mMorphData.insert(belly_data); + mMorphData.insert(cloned_morph_data); } if (!strcmp(morphName, "Big_Belly_Legs")) { - LLPolyMorphData* belly_data = new LLPolyMorphData(*morph_data); - belly_data->mName = std::string("Big_Belly_Legs_Gravity"); - for (U32 v=0; v < belly_data->mNumIndices; v++) + LLPolyMorphData* cloned_morph_data = new LLPolyMorphData(*morph_data); + cloned_morph_data->mName = std::string("Big_Belly_Legs_Gravity"); + for (U32 v=0; v < cloned_morph_data->mNumIndices; v++) { - belly_data->mCoords[v][0] = 0; - belly_data->mCoords[v][1] = 0; - belly_data->mCoords[v][2] = 0.01F; + cloned_morph_data->mCoords[v][0] = 0; + cloned_morph_data->mCoords[v][1] = 0; + cloned_morph_data->mCoords[v][2] = 0.01F; + cloned_morph_data->mNormals[v] = LLVector3(0,0,0); + cloned_morph_data->mBinormals[v] = LLVector3(0,0,0); } - mMorphData.insert(belly_data); + mMorphData.insert(cloned_morph_data); } if (!strcmp(morphName, "skirt_belly")) { - LLPolyMorphData* belly_data = new LLPolyMorphData(*morph_data); - belly_data->mName = std::string("skirt_belly_gravity"); - for (U32 v=0; v < belly_data->mNumIndices; v++) + LLPolyMorphData* cloned_morph_data = new LLPolyMorphData(*morph_data); + cloned_morph_data->mName = std::string("skirt_belly_gravity"); + for (U32 v=0; v < cloned_morph_data->mNumIndices; v++) { - belly_data->mCoords[v][0] = 0; - belly_data->mCoords[v][1] = 0; - belly_data->mCoords[v][2] = 0.01F; + cloned_morph_data->mCoords[v][0] = 0; + cloned_morph_data->mCoords[v][1] = 0; + cloned_morph_data->mCoords[v][2] = 0.01F; + cloned_morph_data->mNormals[v] = LLVector3(0,0,0); + cloned_morph_data->mBinormals[v] = LLVector3(0,0,0); } - mMorphData.insert(belly_data); + mMorphData.insert(cloned_morph_data); } if (!strcmp(morphName, "Small_Butt")) { - LLPolyMorphData* butt_data = new LLPolyMorphData(*morph_data); - butt_data->mName = std::string("Butt_Gravity"); - for (U32 v=0; v < butt_data->mNumIndices; v++) + LLPolyMorphData* cloned_morph_data = new LLPolyMorphData(*morph_data); + cloned_morph_data->mName = std::string("Butt_Gravity"); + for (U32 v=0; v < cloned_morph_data->mNumIndices; v++) { - butt_data->mCoords[v][0] = 0; - butt_data->mCoords[v][1] = 0; - butt_data->mCoords[v][2] = 0.01F; + cloned_morph_data->mCoords[v][0] = 0; + cloned_morph_data->mCoords[v][1] = 0; + cloned_morph_data->mCoords[v][2] = 0.01F; + cloned_morph_data->mNormals[v] = LLVector3(0,0,0); + cloned_morph_data->mBinormals[v] = LLVector3(0,0,0); } - mMorphData.insert(butt_data); + mMorphData.insert(cloned_morph_data); } } -- cgit v1.2.3 From 53a944f2859d07eceed2a01a6b4f7339c0c591d9 Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Fri, 18 Mar 2011 18:02:27 -0400 Subject: Set default parameters. Renamed various parameters. --- indra/newview/character/avatar_lad.xml | 194 ++++++++++++++++++++----- indra/newview/llphysicsmotion.cpp | 53 ++++--- indra/newview/llpolymesh.cpp | 8 +- indra/newview/skins/default/xui/en/strings.xml | 16 +- 4 files changed, 200 insertions(+), 71 deletions(-) diff --git a/indra/newview/character/avatar_lad.xml b/indra/newview/character/avatar_lad.xml index 727a9e7fc4..08102332d0 100644 --- a/indra/newview/character/avatar_lad.xml +++ b/indra/newview/character/avatar_lad.xml @@ -3796,18 +3796,13 @@ + value_max="2"> @@ -4065,16 +4060,11 @@ group="0" sex="female" name="Breast_Gravity" - label="Breast Buoyancy" wearable="shape" edit_group="driven" - label_min="Less Gravity" - label_max="More Gravity" value_default="0" value_min="-1.5" - value_max="2" - camera_elevation=".3" - camera_distance=".8"> + value_max="2"> @@ -4083,16 +4073,11 @@ group="0" sex="female" name="Breast_Female_Cleavage" - label="Breast Cleavage" wearable="shape" edit_group="driven" - label_min="Separate" - label_max="Join" value_default="0" value_min="-.3" - value_max="1.3" - camera_elevation=".3" - camera_distance=".8"> + value_max="1.3"> @@ -4408,7 +4393,7 @@ @@ -9371,8 +9354,8 @@ render_pass="bump"> id="507" group="0" sex="female" - name="Breast_Gravity_Driver" - label="Breast Buoyancy" + name="Breast_Physics_UpDown_Controller" + label="Breast Physics UpDown Controller" wearable="shape" edit_group="shape_torso" edit_group_order="7" @@ -9393,8 +9376,8 @@ render_pass="bump"> id="684" group="0" sex="female" - name="Breast_Female_Cleavage_Driver" - label="Breast Cleavage" + name="Breast_Physics_Side_Controller" + label="Breast Physics Side Controller" wearable="shape" edit_group="shape_torso" edit_group_order="8" @@ -9414,8 +9397,8 @@ render_pass="bump"> wearable="shape" edit_group="shape_torso" edit_group_order="14" - name="Belly_Gravity" - label="Belly Gravity" - label_min="Small" - label_max="Big" - value_min="0" + name="Belly_Physics_UpDown_Controller" + label="Belly Physics UpDown Controller" + label_min="Down" + label_max="Up" + value_min="-1" value_max="1" value_default="0" camera_distance="1.4" @@ -10174,15 +10157,150 @@ render_pass="bump"> - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + initialize()) + { + llassert_always(FALSE); return STATUS_FAILURE; + } addMotion(bounce_motion); controller_map_t controllers_butt_bounce; - controllers_butt_bounce["Mass"] = "Breast_Physics_Mass"; - controllers_butt_bounce["Smoothing"] = "Breast_Physics_Smoothing"; - controllers_butt_bounce["Gravity"] = "Breast_Physics_Gravity"; - controllers_butt_bounce["Damping"] = "Breast_Physics_UpDown_Damping"; - controllers_butt_bounce["Drag"] = "Breast_Physics_UpDown_Drag"; - controllers_butt_bounce["MaxSpeed"] = "Breast_Physics_UpDown_Max_Velocity"; - controllers_butt_bounce["Spring"] = "Breast_Physics_UpDown_Spring"; - controllers_butt_bounce["Gain"] = "Breast_Physics_UpDown_Gain"; - LLPhysicsMotion *butt_bounce_motion = new LLPhysicsMotion("Butt_Gravity_Driver", + controllers_butt_bounce["Damping"] = "Butt_Physics_Updown_Damping"; + controllers_butt_bounce["MaxSpeed"] = "Butt_Physics_Updown_Max_Velocity"; + controllers_butt_bounce["Spring"] = "Butt_Physics_Updown_Spring"; + controllers_butt_bounce["Gain"] = "Butt_Physics_Updown_Gain"; + LLPhysicsMotion *butt_bounce_motion = new LLPhysicsMotion("Butt_Physics_UpDown_Controller", "", "mPelvis", character, LLVector3(0,0,-1), controllers_butt_bounce); if (!butt_bounce_motion->initialize()) + { + llassert_always(FALSE); return STATUS_FAILURE; + } addMotion(butt_bounce_motion); controller_map_t controllers_belly_bounce; - controllers_belly_bounce["Mass"] = "Breast_Physics_Mass"; - controllers_belly_bounce["Smoothing"] = "Breast_Physics_Smoothing"; - controllers_belly_bounce["Gravity"] = "Breast_Physics_Gravity"; - controllers_belly_bounce["Damping"] = "Breast_Physics_UpDown_Damping"; - controllers_belly_bounce["Drag"] = "Breast_Physics_UpDown_Drag"; - controllers_belly_bounce["MaxSpeed"] = "Breast_Physics_UpDown_Max_Velocity"; - controllers_belly_bounce["Spring"] = "Breast_Physics_UpDown_Spring"; - controllers_belly_bounce["Gain"] = "Breast_Physics_UpDown_Gain"; - LLPhysicsMotion *belly_bounce_motion = new LLPhysicsMotion("Belly_Gravity", + controllers_belly_bounce["Damping"] = "Belly_Physics_Updown_Damping"; + controllers_belly_bounce["MaxSpeed"] = "Belly_Physics_Updown_Max_Velocity"; + controllers_belly_bounce["Spring"] = "Belly_Physics_Updown_Spring"; + controllers_belly_bounce["Gain"] = "Belly_Physics_Updown_Gain"; + LLPhysicsMotion *belly_bounce_motion = new LLPhysicsMotion("Belly_Physics_UpDown_Controller", "", "mChest", character, LLVector3(0,0,-1), controllers_belly_bounce); if (!belly_bounce_motion->initialize()) + { + llassert_always(FALSE); return STATUS_FAILURE; + } addMotion(belly_bounce_motion); return STATUS_SUCCESS; @@ -372,8 +373,6 @@ BOOL LLPhysicsMotionController::onUpdate(F32 time, U8* joint_mask) return TRUE; } - if (mCharacter->getSex() != SEX_FEMALE) return TRUE; - BOOL update_visuals = FALSE; for (motion_vec_t::iterator iter = mMotions.begin(); iter != mMotions.end(); diff --git a/indra/newview/llpolymesh.cpp b/indra/newview/llpolymesh.cpp index 4118401a4c..b145b65bac 100644 --- a/indra/newview/llpolymesh.cpp +++ b/indra/newview/llpolymesh.cpp @@ -606,7 +606,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName ) if (!strcmp(morphName, "Big_Belly_Torso")) { LLPolyMorphData* cloned_morph_data = new LLPolyMorphData(*morph_data); - cloned_morph_data->mName = std::string("Big_Belly_Torso_Gravity"); + cloned_morph_data->mName = std::string("Belly_Torso_Physics_UpDown_Driven"); for (U32 v=0; v < morph_data->mNumIndices; v++) { cloned_morph_data->mCoords[v][0] = 0; @@ -621,7 +621,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName ) if (!strcmp(morphName, "Big_Belly_Legs")) { LLPolyMorphData* cloned_morph_data = new LLPolyMorphData(*morph_data); - cloned_morph_data->mName = std::string("Big_Belly_Legs_Gravity"); + cloned_morph_data->mName = std::string("Belly_Legs_Physics_UpDown_Driven"); for (U32 v=0; v < cloned_morph_data->mNumIndices; v++) { cloned_morph_data->mCoords[v][0] = 0; @@ -636,7 +636,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName ) if (!strcmp(morphName, "skirt_belly")) { LLPolyMorphData* cloned_morph_data = new LLPolyMorphData(*morph_data); - cloned_morph_data->mName = std::string("skirt_belly_gravity"); + cloned_morph_data->mName = std::string("Belly_Skirt_Physics_UpDown_Driven"); for (U32 v=0; v < cloned_morph_data->mNumIndices; v++) { cloned_morph_data->mCoords[v][0] = 0; @@ -651,7 +651,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName ) if (!strcmp(morphName, "Small_Butt")) { LLPolyMorphData* cloned_morph_data = new LLPolyMorphData(*morph_data); - cloned_morph_data->mName = std::string("Butt_Gravity"); + cloned_morph_data->mName = std::string("Butt_Physics_UpDown_Driven"); for (U32 v=0; v < cloned_morph_data->mNumIndices; v++) { cloned_morph_data->mCoords[v][0] = 0; diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index 3c7d7d1777..e5d52b03e5 100644 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -2500,8 +2500,8 @@ If you continue to receive this message, contact the [SUPPORT_SITE]. Body Thin Bow Legged -Breast Buoyancy -Breast Cleavage +Breast Buoyancy +Breast Cleavage Breast Size Bridge Width Broad @@ -2527,6 +2527,18 @@ If you continue to receive this message, contact the [SUPPORT_SITE]. Breast UpDown Drag Breast UpDown Max Speed +Belly Updown Bounce +Belly Updown Spring +Belly Updown Gain +Belly Updown Damping +Belly Updown Max Speed + +Butt UpDown Bounce +Butt UpDown Spring +Butt UpDown Gain +Butt UpDown Damping +Butt UpDown Max Speed + Bushy Eyebrows Bushy Hair Butt Size -- cgit v1.2.3 From f2b65e07d0446e8db43b588a3c9e7fa93b7bcebe Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Fri, 18 Mar 2011 18:06:10 -0400 Subject: Took out unnecessary Butt Physics parameter. --- indra/newview/character/avatar_lad.xml | 23 +---------------------- indra/newview/llpolymesh.cpp | 2 +- 2 files changed, 2 insertions(+), 23 deletions(-) diff --git a/indra/newview/character/avatar_lad.xml b/indra/newview/character/avatar_lad.xml index 08102332d0..1c3f87373c 100644 --- a/indra/newview/character/avatar_lad.xml +++ b/indra/newview/character/avatar_lad.xml @@ -4443,7 +4443,7 @@ - - - - - - mName = std::string("Butt_Physics_UpDown_Driven"); + cloned_morph_data->mName = std::string("Butt_Physics_UpDown_Controller"); for (U32 v=0; v < cloned_morph_data->mNumIndices; v++) { cloned_morph_data->mCoords[v][0] = 0; -- cgit v1.2.3 From fc207f935a8d18e7927277f1aa713eb36cc36587 Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Fri, 18 Mar 2011 18:19:25 -0400 Subject: Fixed params for belly morph. Incorrect params were causing distortion in texture maps. --- indra/newview/character/avatar_lad.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/indra/newview/character/avatar_lad.xml b/indra/newview/character/avatar_lad.xml index 1c3f87373c..b839d64980 100644 --- a/indra/newview/character/avatar_lad.xml +++ b/indra/newview/character/avatar_lad.xml @@ -3801,8 +3801,8 @@ wearable="shape" edit_group="driven" value_default="0" - value_min="-2" - value_max="2"> + value_min="0" + value_max="1"> @@ -4396,8 +4396,8 @@ name="Belly_Legs_Physics_UpDown_Driven" wearable="shape" edit_group="driven" - value_min="-2" - value_max="2"> + value_min="0" + value_max="1"> -- cgit v1.2.3 From 49e449e3a6ea08a969a214ffb7c66ac9607e2732 Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Fri, 18 Mar 2011 18:59:59 -0400 Subject: Added more belly bounce. Added butt driver param back in. --- indra/newview/character/avatar_lad.xml | 23 ++++++++++++++++++++++- indra/newview/llphysicsmotion.cpp | 11 +++-------- indra/newview/llpolymesh.cpp | 8 ++++---- 3 files changed, 29 insertions(+), 13 deletions(-) diff --git a/indra/newview/character/avatar_lad.xml b/indra/newview/character/avatar_lad.xml index b839d64980..58fe82da9e 100644 --- a/indra/newview/character/avatar_lad.xml +++ b/indra/newview/character/avatar_lad.xml @@ -4443,7 +4443,7 @@ + + + + + + (mParamUser); + llassert_always(driver_param); if (driver_param) { for (LLDriverParam::entry_list_t::iterator iter = driver_param->mDriven.begin(); @@ -545,10 +544,6 @@ BOOL LLPhysicsMotion::onUpdate(F32 time) setParamValue(driven_param,position_new_local_clamped); } } - else - { - setParamValue(mParamUser,position_new_local_clamped); - } } // diff --git a/indra/newview/llpolymesh.cpp b/indra/newview/llpolymesh.cpp index f287202ff1..626b7ca1eb 100644 --- a/indra/newview/llpolymesh.cpp +++ b/indra/newview/llpolymesh.cpp @@ -611,7 +611,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName ) { cloned_morph_data->mCoords[v][0] = 0; cloned_morph_data->mCoords[v][1] = 0; - cloned_morph_data->mCoords[v][2] = 0.01F; + cloned_morph_data->mCoords[v][2] = 0.05F; cloned_morph_data->mNormals[v] = LLVector3(0,0,0); cloned_morph_data->mBinormals[v] = LLVector3(0,0,0); } @@ -626,7 +626,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName ) { cloned_morph_data->mCoords[v][0] = 0; cloned_morph_data->mCoords[v][1] = 0; - cloned_morph_data->mCoords[v][2] = 0.01F; + cloned_morph_data->mCoords[v][2] = 0.05F; cloned_morph_data->mNormals[v] = LLVector3(0,0,0); cloned_morph_data->mBinormals[v] = LLVector3(0,0,0); } @@ -641,7 +641,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName ) { cloned_morph_data->mCoords[v][0] = 0; cloned_morph_data->mCoords[v][1] = 0; - cloned_morph_data->mCoords[v][2] = 0.01F; + cloned_morph_data->mCoords[v][2] = 0.05F; cloned_morph_data->mNormals[v] = LLVector3(0,0,0); cloned_morph_data->mBinormals[v] = LLVector3(0,0,0); } @@ -651,7 +651,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName ) if (!strcmp(morphName, "Small_Butt")) { LLPolyMorphData* cloned_morph_data = new LLPolyMorphData(*morph_data); - cloned_morph_data->mName = std::string("Butt_Physics_UpDown_Controller"); + cloned_morph_data->mName = std::string("Butt_Physics_UpDown_Driven"); for (U32 v=0; v < cloned_morph_data->mNumIndices; v++) { cloned_morph_data->mCoords[v][0] = 0; -- cgit v1.2.3 From 717d81daa7f42d18ca37eb738ceacfe2b9c1a09a Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Mon, 21 Mar 2011 12:04:31 -0400 Subject: Added left-right butt control. Did a bunch of code cleanup. --- indra/newview/character/avatar_lad.xml | 39 ++++++- indra/newview/llphysicsmotion.cpp | 136 ++++++++++++++----------- indra/newview/llpolymesh.cpp | 82 +++++++-------- indra/newview/skins/default/xui/en/strings.xml | 1 + 4 files changed, 154 insertions(+), 104 deletions(-) diff --git a/indra/newview/character/avatar_lad.xml b/indra/newview/character/avatar_lad.xml index 58fe82da9e..69512cdf34 100644 --- a/indra/newview/character/avatar_lad.xml +++ b/indra/newview/character/avatar_lad.xml @@ -4456,6 +4456,22 @@ + + + + + + + + + + initialize()) + controller_map_t controller_breast_inout; + controller_breast_inout["Mass"] = "Breast_Physics_Mass"; + controller_breast_inout["Smoothing"] = "Breast_Physics_Smoothing"; + controller_breast_inout["Gravity"] = "Breast_Physics_Gravity"; + controller_breast_inout["Damping"] = "Breast_Physics_Side_Damping"; + controller_breast_inout["Drag"] = "Breast_Physics_Side_Drag"; + controller_breast_inout["MaxSpeed"] = "Breast_Physics_Side_Max_Velocity"; + controller_breast_inout["Spring"] = "Breast_Physics_Side_Spring"; + controller_breast_inout["Gain"] = "Breast_Physics_Side_Gain"; + + LLPhysicsMotion *motion_breast_inout = new LLPhysicsMotion("Breast_Physics_Side_Controller", + "", + "mChest", + character, + LLVector3(-1,0,0), + controller_breast_inout); + if (!motion_breast_inout->initialize()) return STATUS_FAILURE; - addMotion(cleavage_motion); - - controller_map_t controllers_bounce; - controllers_bounce["Mass"] = "Breast_Physics_Mass"; - controllers_bounce["Smoothing"] = "Breast_Physics_Smoothing"; - controllers_bounce["Gravity"] = "Breast_Physics_Gravity"; - controllers_bounce["Damping"] = "Breast_Physics_UpDown_Damping"; - controllers_bounce["Drag"] = "Breast_Physics_UpDown_Drag"; - controllers_bounce["MaxSpeed"] = "Breast_Physics_UpDown_Max_Velocity"; - controllers_bounce["Spring"] = "Breast_Physics_UpDown_Spring"; - controllers_bounce["Gain"] = "Breast_Physics_UpDown_Gain"; - - LLPhysicsMotion *bounce_motion = new LLPhysicsMotion("Breast_Physics_UpDown_Controller", - "", - "mChest", - character, - LLVector3(0,0,1), - controllers_bounce); - if (!bounce_motion->initialize()) + addMotion(motion_breast_inout); + + controller_map_t controller_breast_updown; + controller_breast_updown["Mass"] = "Breast_Physics_Mass"; + controller_breast_updown["Smoothing"] = "Breast_Physics_Smoothing"; + controller_breast_updown["Gravity"] = "Breast_Physics_Gravity"; + controller_breast_updown["Damping"] = "Breast_Physics_UpDown_Damping"; + controller_breast_updown["Drag"] = "Breast_Physics_UpDown_Drag"; + controller_breast_updown["MaxSpeed"] = "Breast_Physics_UpDown_Max_Velocity"; + controller_breast_updown["Spring"] = "Breast_Physics_UpDown_Spring"; + controller_breast_updown["Gain"] = "Breast_Physics_UpDown_Gain"; + + LLPhysicsMotion *motion_breast_updown = new LLPhysicsMotion("Breast_Physics_UpDown_Controller", + "", + "mChest", + character, + LLVector3(0,0,1), + controller_breast_updown); + if (!motion_breast_updown->initialize()) { llassert_always(FALSE); return STATUS_FAILURE; } - addMotion(bounce_motion); - - controller_map_t controllers_butt_bounce; - controllers_butt_bounce["Damping"] = "Butt_Physics_Updown_Damping"; - controllers_butt_bounce["MaxSpeed"] = "Butt_Physics_Updown_Max_Velocity"; - controllers_butt_bounce["Spring"] = "Butt_Physics_Updown_Spring"; - controllers_butt_bounce["Gain"] = "Butt_Physics_Updown_Gain"; - LLPhysicsMotion *butt_bounce_motion = new LLPhysicsMotion("Butt_Physics_UpDown_Controller", + addMotion(motion_breast_updown); + + controller_map_t controller_butt_updown; + controller_butt_updown["Damping"] = "Butt_Physics_Updown_Damping"; + controller_butt_updown["MaxSpeed"] = "Butt_Physics_Updown_Max_Velocity"; + controller_butt_updown["Spring"] = "Butt_Physics_Updown_Spring"; + controller_butt_updown["Gain"] = "Butt_Physics_Updown_Gain"; + LLPhysicsMotion *motion_butt_updown = new LLPhysicsMotion("Butt_Physics_UpDown_Controller", "", "mPelvis", character, - LLVector3(0,0,-1), - controllers_butt_bounce); - if (!butt_bounce_motion->initialize()) + LLVector3(0,0,1), + controller_butt_updown); + if (!motion_butt_updown->initialize()) { llassert_always(FALSE); return STATUS_FAILURE; } - addMotion(butt_bounce_motion); - - controller_map_t controllers_belly_bounce; - controllers_belly_bounce["Damping"] = "Belly_Physics_Updown_Damping"; - controllers_belly_bounce["MaxSpeed"] = "Belly_Physics_Updown_Max_Velocity"; - controllers_belly_bounce["Spring"] = "Belly_Physics_Updown_Spring"; - controllers_belly_bounce["Gain"] = "Belly_Physics_Updown_Gain"; - LLPhysicsMotion *belly_bounce_motion = new LLPhysicsMotion("Belly_Physics_UpDown_Controller", + addMotion(motion_butt_updown); + + controller_map_t controller_butt_leftright; + controller_butt_leftright["Damping"] = "Butt_Physics_Updown_Damping"; + controller_butt_leftright["MaxSpeed"] = "Butt_Physics_Updown_Max_Velocity"; + controller_butt_leftright["Spring"] = "Butt_Physics_Updown_Spring"; + controller_butt_leftright["Gain"] = "Butt_Physics_Updown_Gain"; + LLPhysicsMotion *motion_butt_leftright = new LLPhysicsMotion("Butt_Physics_LeftRight_Controller", + "", + "mPelvis", + character, + LLVector3(0,1,0), + controller_butt_leftright); + if (!motion_butt_leftright->initialize()) + { + llassert_always(FALSE); + return STATUS_FAILURE; + } + addMotion(motion_butt_leftright); + + controller_map_t controller_belly_updown; + controller_belly_updown["Damping"] = "Belly_Physics_Updown_Damping"; + controller_belly_updown["MaxSpeed"] = "Belly_Physics_Updown_Max_Velocity"; + controller_belly_updown["Spring"] = "Belly_Physics_Updown_Spring"; + controller_belly_updown["Gain"] = "Belly_Physics_Updown_Gain"; + LLPhysicsMotion *motion_belly_updown = new LLPhysicsMotion("Belly_Physics_UpDown_Controller", "", "mChest", character, LLVector3(0,0,-1), - controllers_belly_bounce); - if (!belly_bounce_motion->initialize()) + controller_belly_updown); + if (!motion_belly_updown->initialize()) { llassert_always(FALSE); return STATUS_FAILURE; } - addMotion(belly_bounce_motion); - + addMotion(motion_belly_updown); + return STATUS_SUCCESS; } diff --git a/indra/newview/llpolymesh.cpp b/indra/newview/llpolymesh.cpp index 626b7ca1eb..a28357b4a9 100644 --- a/indra/newview/llpolymesh.cpp +++ b/indra/newview/llpolymesh.cpp @@ -46,6 +46,10 @@ extern LLControlGroup gSavedSettings; // read only +LLPolyMorphData *clone_morph_param(const LLPolyMorphData *src_data, + const LLVector3 &direction, + const std::string &name); + //----------------------------------------------------------------------------- // Global table of loaded LLPolyMeshes //----------------------------------------------------------------------------- @@ -605,62 +609,36 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName ) if (!strcmp(morphName, "Big_Belly_Torso")) { - LLPolyMorphData* cloned_morph_data = new LLPolyMorphData(*morph_data); - cloned_morph_data->mName = std::string("Belly_Torso_Physics_UpDown_Driven"); - for (U32 v=0; v < morph_data->mNumIndices; v++) - { - cloned_morph_data->mCoords[v][0] = 0; - cloned_morph_data->mCoords[v][1] = 0; - cloned_morph_data->mCoords[v][2] = 0.05F; - cloned_morph_data->mNormals[v] = LLVector3(0,0,0); - cloned_morph_data->mBinormals[v] = LLVector3(0,0,0); - } - mMorphData.insert(cloned_morph_data); + mMorphData.insert(clone_morph_param(morph_data, + LLVector3(0,0,0.05f), + "Belly_Torso_Physics_UpDown_Driven")); } if (!strcmp(morphName, "Big_Belly_Legs")) { - LLPolyMorphData* cloned_morph_data = new LLPolyMorphData(*morph_data); - cloned_morph_data->mName = std::string("Belly_Legs_Physics_UpDown_Driven"); - for (U32 v=0; v < cloned_morph_data->mNumIndices; v++) - { - cloned_morph_data->mCoords[v][0] = 0; - cloned_morph_data->mCoords[v][1] = 0; - cloned_morph_data->mCoords[v][2] = 0.05F; - cloned_morph_data->mNormals[v] = LLVector3(0,0,0); - cloned_morph_data->mBinormals[v] = LLVector3(0,0,0); - } - mMorphData.insert(cloned_morph_data); + mMorphData.insert(clone_morph_param(morph_data, + LLVector3(0,0,0.05f), + "Belly_Legs_Physics_UpDown_Driven")); } if (!strcmp(morphName, "skirt_belly")) { - LLPolyMorphData* cloned_morph_data = new LLPolyMorphData(*morph_data); - cloned_morph_data->mName = std::string("Belly_Skirt_Physics_UpDown_Driven"); - for (U32 v=0; v < cloned_morph_data->mNumIndices; v++) - { - cloned_morph_data->mCoords[v][0] = 0; - cloned_morph_data->mCoords[v][1] = 0; - cloned_morph_data->mCoords[v][2] = 0.05F; - cloned_morph_data->mNormals[v] = LLVector3(0,0,0); - cloned_morph_data->mBinormals[v] = LLVector3(0,0,0); - } - mMorphData.insert(cloned_morph_data); + mMorphData.insert(clone_morph_param(morph_data, + LLVector3(0,0,0.05f), + "Belly_Skirt_Physics_UpDown_Driven")); } if (!strcmp(morphName, "Small_Butt")) { - LLPolyMorphData* cloned_morph_data = new LLPolyMorphData(*morph_data); - cloned_morph_data->mName = std::string("Butt_Physics_UpDown_Driven"); - for (U32 v=0; v < cloned_morph_data->mNumIndices; v++) - { - cloned_morph_data->mCoords[v][0] = 0; - cloned_morph_data->mCoords[v][1] = 0; - cloned_morph_data->mCoords[v][2] = 0.01F; - cloned_morph_data->mNormals[v] = LLVector3(0,0,0); - cloned_morph_data->mBinormals[v] = LLVector3(0,0,0); - } - mMorphData.insert(cloned_morph_data); + mMorphData.insert(clone_morph_param(morph_data, + LLVector3(0,0,0.01f), + "Butt_Physics_UpDown_Driven")); + } + if (!strcmp(morphName, "Small_Butt")) + { + mMorphData.insert(clone_morph_param(morph_data, + LLVector3(0,0.01f,0), + "Butt_Physics_LeftRight_Driven")); } } @@ -1218,4 +1196,20 @@ void LLPolySkeletalDistortion::apply( ESex avatar_sex ) mLastWeight = mCurWeight; } + +LLPolyMorphData *clone_morph_param(const LLPolyMorphData *src_data, + const LLVector3 &direction, + const std::string &name) +{ + LLPolyMorphData* cloned_morph_data = new LLPolyMorphData(*src_data); + cloned_morph_data->mName = name; + for (U32 v=0; v < cloned_morph_data->mNumIndices; v++) + { + cloned_morph_data->mCoords[v] = direction; + cloned_morph_data->mNormals[v] = LLVector3(0,0,0); + cloned_morph_data->mBinormals[v] = LLVector3(0,0,0); + } + return cloned_morph_data; +} + // End diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index e5d52b03e5..e183b0ba78 100644 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -2534,6 +2534,7 @@ If you continue to receive this message, contact the [SUPPORT_SITE]. Belly Updown Max Speed Butt UpDown Bounce +Butt LeftRight Bounce Butt UpDown Spring Butt UpDown Gain Butt UpDown Damping -- cgit v1.2.3 From 77ad0269aca9169dc41bee08ff860373d7715b8c Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Mon, 21 Mar 2011 14:15:41 -0400 Subject: Fixes for physics update thresholds. --- indra/newview/llphysicsmotion.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llphysicsmotion.cpp b/indra/newview/llphysicsmotion.cpp index 87e062a881..2a88a4a2b5 100644 --- a/indra/newview/llphysicsmotion.cpp +++ b/indra/newview/llphysicsmotion.cpp @@ -588,7 +588,7 @@ BOOL LLPhysicsMotion::onUpdate(F32 time) if ((pixel_area > area_for_this_setting) || is_self) { const F32 position_diff_local = llabs(mPositionLastUpdate_local-position_new_local_clamped); - const F32 min_delta = (1.0f-lod_factor)*4.0f; // Magic number 2.0f, can change this if experimentally something works better. + const F32 min_delta = (1.01f-lod_factor)*0.75f; // 75% is just an experimental magic number. if (llabs(position_diff_local) > min_delta) { update_visuals = TRUE; -- cgit v1.2.3 From 209110d1aa7ee369ccdf68641c3d7f9e558427de Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Mon, 21 Mar 2011 15:39:42 -0400 Subject: Velocity now gets zeroed out if the param is pushed beyond limits. Rescaled the max speed param. --- indra/newview/character/avatar_lad.xml | 24 ++++++++++++------------ indra/newview/llphysicsmotion.cpp | 8 +++++++- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/indra/newview/character/avatar_lad.xml b/indra/newview/character/avatar_lad.xml index 69512cdf34..d8f6fd56b3 100644 --- a/indra/newview/character/avatar_lad.xml +++ b/indra/newview/character/avatar_lad.xml @@ -3801,7 +3801,7 @@ wearable="shape" edit_group="driven" value_default="0" - value_min="0" + value_min="-1" value_max="1"> @@ -4396,7 +4396,7 @@ name="Belly_Legs_Physics_UpDown_Driven" wearable="shape" edit_group="driven" - value_min="0" + value_min="-1" value_max="1"> @@ -9141,9 +9141,9 @@ render_pass="bump"> edit_group="physics" label_min="Less" label_max="More" - value_default=".2" + value_default=".1" value_min=".1" - value_max=".5" + value_max="1" camera_elevation=".3" camera_distance=".8"> @@ -9267,9 +9267,9 @@ render_pass="bump"> edit_group="physics" label_min="Less" label_max="More" - value_default=".1" + value_default="0" value_min="0" - value_max=".1" + value_max="10" camera_elevation=".3" camera_distance=".8"> @@ -9358,9 +9358,9 @@ render_pass="bump"> edit_group="physics" label_min="Less" label_max="More" - value_default=".1" + value_default="0" value_min="0" - value_max=".1" + value_max="10" camera_elevation=".3" camera_distance=".8"> @@ -10261,9 +10261,9 @@ render_pass="bump"> edit_group="physics" label_min="Less" label_max="More" - value_default=".1" + value_default="0" value_min="0" - value_max=".1" + value_max="10" camera_elevation=".3" camera_distance=".8"> @@ -10329,9 +10329,9 @@ render_pass="bump"> edit_group="physics" label_min="Less" label_max="More" - value_default=".1" + value_default="0" value_min="0" - value_max=".1" + value_max="10" camera_elevation=".3" camera_distance=".8"> 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); -- cgit v1.2.3 From 45a43256ae71ec7936fc73e3b9c41470a23dd229 Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Mon, 21 Mar 2011 16:18:02 -0400 Subject: Fixed skirt-related belly bounce. --- indra/newview/character/avatar_lad.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/character/avatar_lad.xml b/indra/newview/character/avatar_lad.xml index d8f6fd56b3..160b8f3408 100644 --- a/indra/newview/character/avatar_lad.xml +++ b/indra/newview/character/avatar_lad.xml @@ -5192,7 +5192,7 @@ wearable="skirt" edit_group="driven" cross_wearable="true" - value_min="0" + value_min="-1" value_max="1"> -- cgit v1.2.3