Added left-right butt control.

Did a bunch of code cleanup.
meow-7.2.2
Loren Shih 2011-03-21 12:04:31 -04:00
parent 00e98c2c12
commit 3524b112bd
4 changed files with 149 additions and 99 deletions

View File

@ -4456,6 +4456,22 @@
<param_morph />
</param>
<param
id="1090"
group="0"
name="Butt_Physics_LeftRight_Driven"
wearable="shape"
edit_group="driven"
label_min="Separate"
label_max="Join"
value_default="0"
value_min="-2"
value_max="2"
camera_elevation=".3"
camera_distance=".8">
<param_morph />
</param>
<param
id="152"
group="1"
@ -9351,7 +9367,7 @@ render_pass="bump">
</param>
<param
id="1090"
id="1104"
group="0"
wearable="shape"
edit_group="shape_legs"
@ -9371,6 +9387,27 @@ render_pass="bump">
</param_driver>
</param>
<param
id="1105"
group="0"
wearable="shape"
edit_group="shape_legs"
edit_group_order="15"
name="Butt_Physics_LeftRight_Controller"
label="Butt Physics LeftRight Controller"
label_min="Down"
label_max="Up"
value_min="-1"
value_max="1"
value_default="0"
camera_elevation=".3"
camera_distance=".8">
<param_driver>
<driven
id="1090" />
</param_driver>
</param>
<param
id="507"
group="0"

View File

@ -238,85 +238,103 @@ LLMotion::LLMotionInitStatus LLPhysicsMotionController::onInitialize(LLCharacter
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";
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 *cleavage_motion = new LLPhysicsMotion("Breast_Physics_Side_Controller",
"",
"mChest",
character,
LLVector3(-1,0,0),
controllers_cleavage);
if (!cleavage_motion->initialize())
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);
addMotion(motion_breast_inout);
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";
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 *bounce_motion = new LLPhysicsMotion("Breast_Physics_UpDown_Controller",
"",
"mChest",
character,
LLVector3(0,0,1),
controllers_bounce);
if (!bounce_motion->initialize())
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);
addMotion(motion_breast_updown);
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",
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);
addMotion(motion_butt_updown);
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",
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;
}

View File

@ -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

View File

@ -2533,6 +2533,7 @@ If you continue to receive this message, contact the [SUPPORT_SITE].
<string name="Belly Physics UpDown Max Speed">Belly Updown Max Speed</string>
<string name="Butt Physics UpDown Controller">Butt UpDown Bounce</string>
<string name="Butt Physics LeftRight Controller">Butt LeftRight Bounce</string>
<string name="Butt Physics UpDown Spring">Butt UpDown Spring</string>
<string name="Butt Physics UpDown Gain">Butt UpDown Gain</string>
<string name="Butt Physics UpDown Damping">Butt UpDown Damping</string>