FIRE-30963 - better physics defaults
parent
52ce165290
commit
e2fd2687d4
|
|
@ -9399,6 +9399,17 @@
|
|||
<key>Value</key>
|
||||
<string>salt_and_pepper.jpg</string>
|
||||
</map>
|
||||
<key>FSPhysicsPresetUser1</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>full system path to a user provided physics mesh (DAE).</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>String</string>
|
||||
<key>Value</key>
|
||||
<string></string>
|
||||
</map>
|
||||
<key>MigrateCacheDirectory</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,74 @@
|
|||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<COLLADA version="1.4.1" xmlns="http://www.collada.org/2005/11/COLLADASchema">
|
||||
<asset>
|
||||
<contributor>
|
||||
<author>Avastar User</author>
|
||||
<authoring_tool>Avastar 2-0-10 on Blender 2.78 (sub 0)</authoring_tool>
|
||||
</contributor>
|
||||
<created>2017-02-03T17:31:59</created>
|
||||
<modified>2017-02-03T17:31:59</modified>
|
||||
<unit meter="1" name="meter" />
|
||||
<up_axis>Z_UP</up_axis>
|
||||
</asset>
|
||||
<library_cameras />
|
||||
<library_lights />
|
||||
<library_effects />
|
||||
<library_materials />
|
||||
<library_geometries>
|
||||
<geometry id="Cube_023-mesh" name="Cube.023">
|
||||
<mesh>
|
||||
<source id="Cube_023-mesh-positions">
|
||||
<float_array count="24" id="Cube_023-mesh-positions-array">-0.4 -0.4 -0.4 -0.4 -0.4 0.4 -0.4 0.4 -0.4 -0.4 0.4 0.4 0.4 -0.4 -0.4 0.4 -0.4 0.4 0.4 0.4 -0.4 0.4 0.4 0.4 </float_array>
|
||||
<technique_common>
|
||||
<accessor count="8" source="#Cube_023-mesh-positions-array" stride="3">
|
||||
<param name="X" type="float" />
|
||||
<param name="Y" type="float" />
|
||||
<param name="Z" type="float" />
|
||||
</accessor>
|
||||
</technique_common>
|
||||
</source>
|
||||
<source id="Cube_023-mesh-normals">
|
||||
<float_array count="18" id="Cube_023-mesh-normals-array">-1 -0 0 0 1 0 1 -0 0 0 -1 0 0 0 -1 0 -0 1 </float_array>
|
||||
<technique_common>
|
||||
<accessor count="6" source="#Cube_023-mesh-normals-array" stride="3">
|
||||
<param name="X" type="float" />
|
||||
<param name="Y" type="float" />
|
||||
<param name="Z" type="float" />
|
||||
</accessor>
|
||||
</technique_common>
|
||||
</source>
|
||||
<vertices id="Cube_023-mesh-vertices">
|
||||
<input semantic="POSITION" source="#Cube_023-mesh-positions" />
|
||||
</vertices>
|
||||
<polylist count="12">
|
||||
<input offset="0" semantic="VERTEX" source="#Cube_023-mesh-vertices" />
|
||||
<input offset="1" semantic="NORMAL" source="#Cube_023-mesh-normals" />
|
||||
<vcount>4 4 4 4 4 4</vcount>
|
||||
<p>0 0 1 0 3 0 2 0 2 1 3 1 7 1 6 1 6 2 7 2 5 2 4 2 4 3 5 3 1 3 0 3 2 4 6 4 4 4 0 4 7 5 3 5 1 5 5 5 </p>
|
||||
</polylist>
|
||||
</mesh>
|
||||
<extra>
|
||||
<technique profile="MAYA">
|
||||
<double_sided>1</double_sided>
|
||||
</technique>
|
||||
</extra>
|
||||
</geometry>
|
||||
</library_geometries>
|
||||
<library_controllers />
|
||||
<library_visual_scenes>
|
||||
<visual_scene id="Scene" name="Scene">
|
||||
<node id="Cube_023" name="Cube_023" type="NODE">
|
||||
<translate sid="location">5.93563 6.77334 -14.9673</translate>
|
||||
<rotate sid="rotationZ">0 0 1 0</rotate>
|
||||
<rotate sid="rotationY">0 1 0 0</rotate>
|
||||
<rotate sid="rotationX">1 0 0 0</rotate>
|
||||
<scale sid="scale">1 1 1</scale>
|
||||
<instance_geometry url="#Cube_023-mesh" />
|
||||
</node>
|
||||
</visual_scene>
|
||||
</library_visual_scenes>
|
||||
<scene>
|
||||
<instance_visual_scene url="#Scene" />
|
||||
</scene>
|
||||
</COLLADA>
|
||||
|
||||
|
|
@ -0,0 +1,70 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<COLLADA xmlns="http://www.collada.org/2005/11/COLLADASchema" version="1.4.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<asset>
|
||||
<contributor>
|
||||
<author>Blender User</author>
|
||||
<authoring_tool>Blender 2.80.43 commit date:2019-01-29, commit time:22:41, hash:a1ae04d15a9f</authoring_tool>
|
||||
</contributor>
|
||||
<created>2019-02-05T14:28:24</created>
|
||||
<modified>2019-02-05T14:28:24</modified>
|
||||
<unit name="meter" meter="1"/>
|
||||
<up_axis>Z_UP</up_axis>
|
||||
</asset>
|
||||
<library_images/>
|
||||
<library_geometries>
|
||||
<geometry id="Cylinder-mesh" name="Cylinder">
|
||||
<mesh>
|
||||
<source id="Cylinder-mesh-positions">
|
||||
<float_array id="Cylinder-mesh-positions-array" count="36">0 1 -1 0 1 1 0.8660255 0.5 -1 0.8660255 0.5 1 0.8660254 -0.5000001 -1 0.8660254 -0.5000001 1 0 -1 -1 0 -1 1 -0.8660255 -0.4999999 -1 -0.8660255 -0.4999999 1 -0.8660255 0.4999999 -1 -0.8660255 0.4999999 1</float_array>
|
||||
<technique_common>
|
||||
<accessor source="#Cylinder-mesh-positions-array" count="12" stride="3">
|
||||
<param name="X" type="float"/>
|
||||
<param name="Y" type="float"/>
|
||||
<param name="Z" type="float"/>
|
||||
</accessor>
|
||||
</technique_common>
|
||||
</source>
|
||||
<source id="Cylinder-mesh-normals">
|
||||
<float_array id="Cylinder-mesh-normals-array" count="48">0.5 0.8660255 0 1 0 0 0.5 -0.8660255 0 -0.5000001 -0.8660253 0 0 0 1 -1 0 0 -0.5000001 0.8660255 0 0 0 -1 1 -1.19209e-7 0 0.5 -0.8660255 0 -0.5000001 -0.8660254 0 0 0 1 1.37651e-7 0 1 0 0 1 1.37651e-7 0 -1 1.37651e-7 0 -1</float_array>
|
||||
<technique_common>
|
||||
<accessor source="#Cylinder-mesh-normals-array" count="16" stride="3">
|
||||
<param name="X" type="float"/>
|
||||
<param name="Y" type="float"/>
|
||||
<param name="Z" type="float"/>
|
||||
</accessor>
|
||||
</technique_common>
|
||||
</source>
|
||||
<source id="Cylinder-mesh-map">
|
||||
<float_array id="Cylinder-mesh-map-array" count="120">1 1 0.8333333 0.5 1 0.5 0.8333333 1 0.6666666 0.5 0.8333333 0.5 0.6666666 1 0.5 0.5 0.6666666 0.5 0.5 1 0.3333333 0.5 0.5 0.5 0.25 0.49 0.04215389 0.13 0.4578461 0.1299999 0.3333333 1 0.1666666 0.5 0.3333333 0.5 0.1666666 1 0 0.5 0.1666666 0.5 0.5421539 0.13 0.5421539 0.37 0.9578461 0.37 1 1 0.8333333 1 0.8333333 0.5 0.8333333 1 0.6666666 1 0.6666666 0.5 0.6666666 1 0.5 1 0.5 0.5 0.5 1 0.3333333 1 0.3333333 0.5 0.4578461 0.1299999 0.4578461 0.37 0.25 0.49 0.25 0.49 0.04215389 0.37 0.04215389 0.13 0.04215389 0.13 0.25 0.00999999 0.4578461 0.1299999 0.3333333 1 0.1666666 1 0.1666666 0.5 0.1666666 1 0 1 0 0.5 0.5421539 0.37 0.75 0.49 0.9578461 0.37 0.9578461 0.37 0.9578461 0.1299999 0.75 0.00999999 0.75 0.00999999 0.5421539 0.13 0.9578461 0.37</float_array>
|
||||
<technique_common>
|
||||
<accessor source="#Cylinder-mesh-map-array" count="60" stride="2">
|
||||
<param name="S" type="float"/>
|
||||
<param name="T" type="float"/>
|
||||
</accessor>
|
||||
</technique_common>
|
||||
</source>
|
||||
<vertices id="Cylinder-mesh-vertices">
|
||||
<input semantic="POSITION" source="#Cylinder-mesh-positions"/>
|
||||
</vertices>
|
||||
<polylist count="20">
|
||||
<input semantic="VERTEX" source="#Cylinder-mesh-vertices" offset="0"/>
|
||||
<input semantic="NORMAL" source="#Cylinder-mesh-normals" offset="1"/>
|
||||
<input semantic="TEXCOORD" source="#Cylinder-mesh-map" offset="2" set="0"/>
|
||||
<vcount>3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 </vcount>
|
||||
<p>1 0 0 2 0 1 0 0 2 3 1 3 4 1 4 2 1 5 5 2 6 6 2 7 4 2 8 7 3 9 8 3 10 6 3 11 1 4 12 9 4 13 5 4 14 9 5 15 10 5 16 8 5 17 11 6 18 0 6 19 10 6 20 8 7 21 10 7 22 2 7 23 1 0 24 3 0 25 2 0 26 3 8 27 5 8 28 4 8 29 5 9 30 7 9 31 6 9 32 7 10 33 9 10 34 8 10 35 5 11 36 3 11 37 1 11 38 1 12 39 11 12 40 9 12 41 9 13 42 7 13 43 5 13 44 9 5 45 11 5 46 10 5 47 11 6 48 1 6 49 0 6 50 10 14 51 0 14 52 2 14 53 2 15 54 4 15 55 6 15 56 6 7 57 8 7 58 2 7 59</p>
|
||||
</polylist>
|
||||
</mesh>
|
||||
</geometry>
|
||||
</library_geometries>
|
||||
<library_visual_scenes>
|
||||
<visual_scene id="Scene" name="Scene">
|
||||
<node id="Cylinder" name="Cylinder" type="NODE">
|
||||
<matrix sid="transform">1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1</matrix>
|
||||
<instance_geometry url="#Cylinder-mesh" name="Cylinder"/>
|
||||
</node>
|
||||
</visual_scene>
|
||||
</library_visual_scenes>
|
||||
<scene>
|
||||
<instance_visual_scene url="#Scene"/>
|
||||
</scene>
|
||||
</COLLADA>
|
||||
|
|
@ -1139,8 +1139,21 @@ void LLFloaterModelPreview::onPhysicsUseLOD(LLUICtrl* ctrl, void* userdata)
|
|||
S32 file_mode = iface->getItemCount() - 1;
|
||||
if (which_mode < file_mode)
|
||||
{
|
||||
S32 which_lod = num_lods - which_mode;
|
||||
sInstance->mModelPreview->setPhysicsFromLOD(which_lod);
|
||||
// <FS:Beq> FIRE-30963 Support pre-defined physics shapes (initially cube)
|
||||
// S32 which_lod = num_lods - which_mode;
|
||||
// sInstance->mModelPreview->setPhysicsFromLOD(which_lod);
|
||||
if(which_mode >= num_lods)
|
||||
{
|
||||
// which_mode is between the last LOD entry and file selection
|
||||
// so it is a preset
|
||||
sInstance->mModelPreview->setPhysicsFromPreset(which_mode-num_lods);
|
||||
}
|
||||
else
|
||||
{
|
||||
S32 which_lod = num_lods - which_mode;
|
||||
sInstance->mModelPreview->setPhysicsFromLOD(which_lod);
|
||||
}
|
||||
// </FS:Beq>
|
||||
}
|
||||
|
||||
LLModelPreview *model_preview = sInstance->mModelPreview;
|
||||
|
|
@ -1747,7 +1760,7 @@ void LLFloaterModelPreview::setCtrlLoadFromFile(S32 lod)
|
|||
LLComboBox* lod_combo = findChild<LLComboBox>("physics_lod_combo");
|
||||
if (lod_combo)
|
||||
{
|
||||
lod_combo->setCurrentByIndex(5);
|
||||
lod_combo->setCurrentByIndex(lod_combo->getItemCount() - 1); // <FS:Beq/> FIRE-30963 - better physics defaults
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
|
|||
|
|
@ -923,7 +923,38 @@ void LLModelPreview::setPhysicsFromLOD(S32 lod)
|
|||
updateStatusMessages();
|
||||
}
|
||||
}
|
||||
// <FS:Beq> FIRE-30963 - better physics defaults
|
||||
void LLModelPreview::setPhysicsFromPreset(S32 preset)
|
||||
{
|
||||
assert_main_thread();
|
||||
|
||||
mPhysicsSearchLOD = -1;
|
||||
mLODFile[LLModel::LOD_PHYSICS].clear();
|
||||
mFMP->childSetValue("physics_file", mLODFile[LLModel::LOD_PHYSICS]);
|
||||
mVertexBuffer[LLModel::LOD_PHYSICS].clear();
|
||||
if(preset == 1)
|
||||
{
|
||||
mPhysicsSearchLOD = LLModel::LOD_PHYSICS;
|
||||
loadModel( gDirUtilp->getExpandedFilename(LL_PATH_FS_RESOURCES, "cube_phys.dae"), LLModel::LOD_PHYSICS);
|
||||
}
|
||||
else if(preset == 2)
|
||||
{
|
||||
mPhysicsSearchLOD = LLModel::LOD_PHYSICS;
|
||||
loadModel( gDirUtilp->getExpandedFilename(LL_PATH_FS_RESOURCES, "hex_phys.dae"), LLModel::LOD_PHYSICS);
|
||||
}
|
||||
else if(preset == 3)
|
||||
{
|
||||
auto ud_physics = gSavedSettings.getString("FSPhysicsPresetUser1");
|
||||
LL_INFOS() << "Loading User defined Physics Preset [" << ud_physics << "]" << LL_ENDL;
|
||||
if (ud_physics != "" && gDirUtilp->fileExists(ud_physics))
|
||||
{
|
||||
// loading physics from file
|
||||
mPhysicsSearchLOD = LLModel::LOD_PHYSICS;
|
||||
loadModel( gDirUtilp->getExpandedFilename(LL_PATH_NONE, gDirUtilp->getDirName(ud_physics), gDirUtilp->getBaseFileName(ud_physics, false)), LLModel::LOD_PHYSICS);
|
||||
}
|
||||
}
|
||||
}
|
||||
// </FS:Beq>
|
||||
void LLModelPreview::clearIncompatible(S32 lod)
|
||||
{
|
||||
//Don't discard models if specified model is the physic rep
|
||||
|
|
|
|||
|
|
@ -139,6 +139,7 @@ public:
|
|||
void setTexture(U32 name) { mTextureName = name; }
|
||||
|
||||
void setPhysicsFromLOD(S32 lod);
|
||||
void setPhysicsFromPreset(S32 preset);// <FS:Beq/> FIRE-30963 - better physics defaults
|
||||
BOOL render();
|
||||
void update();
|
||||
void genBuffers(S32 lod, bool skinned);
|
||||
|
|
|
|||
|
|
@ -788,6 +788,9 @@
|
|||
<combo_item name="physics_medium"> Medium </combo_item>
|
||||
<combo_item name="physics_low"> Low </combo_item>
|
||||
<combo_item name="physics_lowest"> Lowest </combo_item>
|
||||
<combo_item name="physics_cube"> Cube </combo_item>
|
||||
<combo_item name="physics_hex"> Hexagon </combo_item>
|
||||
<combo_item name="physics_ud"> User Defined </combo_item>
|
||||
<combo_item name="load_from_file"> From file </combo_item>
|
||||
</combo_box>
|
||||
<line_editor
|
||||
|
|
@ -1415,12 +1418,35 @@
|
|||
<check_box
|
||||
control_name="FSMeshUploadAutoShowWeightsWhenEnabled"
|
||||
follows="top|left"
|
||||
top_pad="8"
|
||||
left="24"
|
||||
left_pad="5"
|
||||
width="300"
|
||||
label="Auto-preview weights"
|
||||
tool_tip="Automatically show weights in preview for meshes with rigging info"
|
||||
name="mesh_preview_auto_show_weights"/>
|
||||
<text
|
||||
follows="left|top"
|
||||
layout="topleft"
|
||||
left="24"
|
||||
height="12"
|
||||
name="mesh_preview_ud_preset_label"
|
||||
top_pad="10"
|
||||
width="200">
|
||||
Physics User Defined Preset:
|
||||
</text>
|
||||
<line_editor
|
||||
control_name="FSPhysicsPresetUser1"
|
||||
border_style="line"
|
||||
border_thickness="1"
|
||||
follows="left|top"
|
||||
font="SansSerif"
|
||||
height="23"
|
||||
top_delta="-7"
|
||||
layout="topleft"
|
||||
left_pad="5"
|
||||
max_length_chars="4096"
|
||||
name="ud_physics"
|
||||
tool_tip="Full system path to a simple Collada mesh definition to be used for physics."
|
||||
width="270" />
|
||||
<text
|
||||
follows="left|top"
|
||||
layout="topleft"
|
||||
|
|
|
|||
|
|
@ -172,6 +172,7 @@ class ViewerManifest(LLManifest,FSViewerManifest):
|
|||
# <FS:AO> Include firestorm resources
|
||||
with self.prefix(src_dst="fs_resources"):
|
||||
self.path("*.lsltxt")
|
||||
self.path("*.dae") # <FS:Beq> FIRE-30963 - better physics defaults
|
||||
|
||||
# skins
|
||||
with self.prefix(src_dst="skins"):
|
||||
|
|
|
|||
Loading…
Reference in New Issue