Commits

Seraph Linden  committed b1061f1

Added breast sway (left-right).

  • Participants
  • Parent commits a8fcfdd

Comments (0)

Files changed (6)

File indra/newview/character/avatar_lad.xml

       <param_morph />
     </param>
 
+    <param
+     id="1207"
+     group="1"
+     name="Breast_Physics_LeftRight_Driven"
+     wearable="physics"
+     edit_group="driven"
+     value_default="0"
+     value_min="-2"
+     value_max="2">
+      <param_morph />
+    </param>
+
     <!--
          #end morph targets
           -->
       <param_morph />
     </param>
 
-
     <!--
             #end morph targets
             -->
     </param>
 
     <param
+     id="1105"
+     group="1"
+     wearable="shape"
+     name="Breast_Physics_LeftRight_Controller"
+     label="Breast Physics LeftRight Controller"
+     value_min="-1"
+     value_max="1"
+     value_default="0">
+      <param_driver>
+        <driven
+         id="1207" />
+      </param_driver>
+    </param>
+
+    <param
      id="10000"
      group="0"
      sex="female"
 	 <param_driver />
     </param>
 
+   <param
+     id="10032"
+     group="0"
+     name="Breast_Physics_LeftRight_Max_Velocity"
+     label="Breast Physics LeftRight Max Speed"
+     wearable="physics"
+     edit_group="physics_breasts_leftright"
+     value_default="0"
+     value_min="0"
+     value_max="10">
+	 <param_driver />
+    </param>
+    <param
+     id="10033"
+     group="0"
+     name="Breast_Physics_LeftRight_Spring"
+     label="Breast Physics LeftRight Spring"
+     wearable="physics"
+     edit_group="physics_breasts_leftright"
+     value_default=".1"
+     value_min="0"
+     value_max="1">
+	 <param_driver />
+    </param>
+    <param
+     id="10034"
+     group="0"
+     name="Breast_Physics_LeftRight_Gain"
+     label="Breast Physics LeftRight Gain"
+     wearable="physics"
+     edit_group="physics_breasts_leftright"
+     value_default="10"
+     value_min="1"
+     value_max="100">
+	 <param_driver />
+    </param>
+    <param
+     id="10035"
+     group="0"
+     name="Breast_Physics_LeftRight_Damping"
+     label="Breast Physics LeftRight Damping"
+     wearable="physics"
+     edit_group="physics_breasts_leftright"
+     value_default=".05"
+     value_min="0"
+     value_max=".1">
+	 <param_driver />
+    </param>
+
   </driver_parameters>
 
   <morph_masks>

File indra/newview/llpaneleditwearable.cpp

         SUBPART_TATTOO,
         SUBPART_PHYSICS_BREASTS_UPDOWN,
         SUBPART_PHYSICS_BREASTS_INOUT,
+        SUBPART_PHYSICS_BREASTS_LEFTRIGHT,
         SUBPART_PHYSICS_BELLY_UPDOWN,
         SUBPART_PHYSICS_BUTT_UPDOWN,
         SUBPART_PHYSICS_BUTT_LEFTRIGHT,
         addEntry(LLWearableType::WT_SKIRT,              new WearableEntry(LLWearableType::WT_SKIRT,"edit_skirt_title","skirt_desc_text",1,1,1, TEX_SKIRT, TEX_SKIRT, SUBPART_SKIRT));
         addEntry(LLWearableType::WT_ALPHA,              new WearableEntry(LLWearableType::WT_ALPHA,"edit_alpha_title","alpha_desc_text",0,5,1, TEX_LOWER_ALPHA, TEX_UPPER_ALPHA, TEX_HEAD_ALPHA, TEX_EYES_ALPHA, TEX_HAIR_ALPHA, SUBPART_ALPHA));
         addEntry(LLWearableType::WT_TATTOO,     new WearableEntry(LLWearableType::WT_TATTOO,"edit_tattoo_title","tattoo_desc_text",1,3,1, TEX_HEAD_TATTOO, TEX_LOWER_TATTOO, TEX_UPPER_TATTOO, TEX_HEAD_TATTOO, SUBPART_TATTOO));
-        addEntry(LLWearableType::WT_PHYSICS,    new WearableEntry(LLWearableType::WT_PHYSICS,"edit_physics_title","physics_desc_text",0,0,6, SUBPART_PHYSICS_BREASTS_UPDOWN, SUBPART_PHYSICS_BREASTS_INOUT, SUBPART_PHYSICS_BELLY_UPDOWN, SUBPART_PHYSICS_BUTT_UPDOWN, SUBPART_PHYSICS_BUTT_LEFTRIGHT, SUBPART_PHYSICS_ADVANCED));
+        addEntry(LLWearableType::WT_PHYSICS,    new WearableEntry(LLWearableType::WT_PHYSICS,"edit_physics_title","physics_desc_text",0,0,7, SUBPART_PHYSICS_BREASTS_UPDOWN, SUBPART_PHYSICS_BREASTS_INOUT, SUBPART_PHYSICS_BREASTS_LEFTRIGHT, SUBPART_PHYSICS_BELLY_UPDOWN, SUBPART_PHYSICS_BUTT_UPDOWN, SUBPART_PHYSICS_BUTT_LEFTRIGHT, SUBPART_PHYSICS_ADVANCED));
 }
 
 LLEditWearableDictionary::WearableEntry::WearableEntry(LLWearableType::EType type,
         addEntry(SUBPART_TATTOO, new SubpartEntry(SUBPART_TATTOO, "mPelvis", "tattoo", "tattoo_main_param_list", "tattoo_main_tab", LLVector3d(0.f, 0.f, 0.1f), LLVector3d(-2.5f, 0.5f, 0.8f),SEX_BOTH));
         addEntry(SUBPART_PHYSICS_BREASTS_UPDOWN, new SubpartEntry(SUBPART_PHYSICS_BREASTS_UPDOWN, "mTorso", "physics_breasts_updown", "physics_breasts_updown_param_list", "physics_breasts_updown_tab", LLVector3d(0.f, 0.f, 0.3f), LLVector3d(0.f, 0.f, 0.f),SEX_FEMALE));
         addEntry(SUBPART_PHYSICS_BREASTS_INOUT, new SubpartEntry(SUBPART_PHYSICS_BREASTS_INOUT, "mTorso", "physics_breasts_inout", "physics_breasts_inout_param_list", "physics_breasts_inout_tab", LLVector3d(0.f, 0.f, 0.3f), LLVector3d(0.f, 0.f, 0.f),SEX_FEMALE));
+        addEntry(SUBPART_PHYSICS_BREASTS_LEFTRIGHT, new SubpartEntry(SUBPART_PHYSICS_BREASTS_LEFTRIGHT, "mTorso", "physics_breasts_leftright", "physics_breasts_leftright_param_list", "physics_breasts_leftright_tab", LLVector3d(0.f, 0.f, 0.3f), LLVector3d(0.f, 0.f, 0.f),SEX_FEMALE));
         addEntry(SUBPART_PHYSICS_BELLY_UPDOWN, new SubpartEntry(SUBPART_PHYSICS_BELLY_UPDOWN, "mTorso", "physics_belly_updown", "physics_belly_updown_param_list", "physics_belly_updown_tab", LLVector3d(0.f, 0.f, 0.3f), LLVector3d(0.f, 0.f, 0.f),SEX_BOTH));
         addEntry(SUBPART_PHYSICS_BUTT_UPDOWN, new SubpartEntry(SUBPART_PHYSICS_BUTT_UPDOWN, "mTorso", "physics_butt_updown", "physics_butt_updown_param_list", "physics_butt_updown_tab", LLVector3d(0.f, 0.f, 0.3f), LLVector3d(0.f, 0.f, 0.f),SEX_BOTH));
         addEntry(SUBPART_PHYSICS_BUTT_LEFTRIGHT, new SubpartEntry(SUBPART_PHYSICS_BUTT_LEFTRIGHT, "mTorso", "physics_butt_leftright", "physics_butt_leftright_param_list", "physics_butt_leftright_tab", LLVector3d(0.f, 0.f, 0.f), LLVector3d(0.f, 0.f, 0.f),SEX_BOTH));

File indra/newview/llphysicsmotion.cpp

                 }
                 addMotion(motion);
         }
+
+        // Breast Sway
+        {
+                controller_map_t controller;
+                controller["Mass"] = "Breast_Physics_Mass";
+                controller["Smoothing"] = "Breast_Physics_Smoothing";
+                controller["Gravity"] = "Breast_Physics_Gravity";
+                controller["Drag"] = "Breast_Physics_Drag";
+                controller["Damping"] = "Breast_Physics_LeftRight_Damping";
+                controller["MaxSpeed"] = "Breast_Physics_LeftRight_Max_Velocity";
+                controller["Spring"] = "Breast_Physics_LeftRight_Spring";
+                controller["Gain"] = "Breast_Physics_LeftRight_Gain";
+                LLPhysicsMotion *motion = new LLPhysicsMotion("Breast_Physics_LeftRight_Controller",
+                                                                                                          "",
+                                                                                                          "mChest",
+                                                                                                          character,
+                                                                                                          LLVector3(0,-1,0),
+                                                                                                          controller);
+                if (!motion->initialize())
+                {
+                        llassert_always(FALSE);
+                        return STATUS_FAILURE;
+                }
+                addMotion(motion);
+        }
         
         // Butt Bounce
         {

File indra/newview/llpolymesh.cpp

 LLPolyMorphData *clone_morph_param(const LLPolyMorphData *src_data,
 				   const LLVector3 &direction,
 				   const std::string &name);
+LLPolyMorphData *clone_morph_param_cleavage(const LLPolyMorphData *src_data,
+                                            F32 scale,
+                                            const std::string &name);
 
 //-----------------------------------------------------------------------------
 // Global table of loaded LLPolyMeshes
 
 				mMorphData.insert(morph_data);
 
+				if (!strcmp(morphName, "Breast_Female_Cleavage"))
+				{
+                                    mMorphData.insert(clone_morph_param_cleavage(morph_data,
+                                                                                 0.5f,
+                                                                                 "Breast_Physics_LeftRight_Driven"));
+				}
+
 				if (!strcmp(morphName, "Big_Belly_Torso"))
 				{
 					mMorphData.insert(clone_morph_param(morph_data,
 	return cloned_morph_data;
 }
 
+LLPolyMorphData *clone_morph_param_cleavage(const LLPolyMorphData *src_data,
+                                            F32 scale,
+                                            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] = src_data->mCoords[v]*scale;
+            cloned_morph_data->mNormals[v] = src_data->mNormals[v]*scale;
+            cloned_morph_data->mBinormals[v] = src_data->mBinormals[v]*scale;
+            if (cloned_morph_data->mCoords[v][1] < 0)
+            {
+                cloned_morph_data->mCoords[v][1] *= -1;
+                cloned_morph_data->mNormals[v][1] *= -1;
+                cloned_morph_data->mBinormals[v][1] *= -1;
+            }
+	}
+	return cloned_morph_data;
+}
+
 // End

File indra/newview/skins/default/xui/en/panel_edit_physics.xml

 			layout="topleft"
 			fit_panel="false"
 			min_height="50"
+			name="physics_breasts_leftright_tab"
+			title="Breasts Sway">
+			<scrolling_panel_list
+				follows="all"
+				layout="topleft"
+				left="0"
+				name="physics_breasts_leftright_param_list"
+				top_pad="50"
+				width="303" />
+		</accordion_tab>
+		<accordion_tab
+			layout="topleft"
+			fit_panel="false"
+			min_height="50"
 			name="physics_belly_tab"
 			title="Belly Bounce">
 			<scrolling_panel_list

File indra/newview/skins/default/xui/en/strings.xml

 <string name="Breast Physics UpDown Gain">Gain</string>
 <string name="Breast Physics UpDown Damping">Damping</string>
 
+<string name="Breast Physics LeftRight Max Speed">Max Effect</string>
+<string name="Breast Physics LeftRight Spring">Spring</string>
+<string name="Breast Physics LeftRight Gain">Gain</string>
+<string name="Breast Physics LeftRight Damping">Damping</string>
+
 <string name="Belly Physics Mass">Belly Mass</string>
 <string name="Belly Physics Smoothing">Belly Smoothing</string>
 <string name="Belly Physics Gravity">Belly Gravity</string>