}
lindenMeshesLoaded = true;
- }
+ }\r
+\r
+ \r
public void applyMorph(Avatar av, int param, float weight)
- {
+ {\r
VisualParamEx vpx;
+
if (VisualParamEx.allParams.TryGetValue(param, out vpx))
- {
+ {\r
+ applyMorph(vpx, av, param, weight);\r
+\r
+ foreach (VisualParamEx cvpx in vpx.identicalIds)\r
+ {\r
+ applyMorph(vpx, av, param, weight);\r
+ }
+ }
+ }
+
+ public void applyMorph(VisualParamEx vpx, Avatar av, int param, float weight)\r
+ {\r
-
if (weight < 0)
weight = 0;
if (mesh.Name == "skirtMesh" && _showSkirt == false)
return;
- mesh.morphmesh(morph, weight);
+ mesh.morphmesh(morph, value);
continue;
}
{
// scale="0 0 .3" />
// value_min="-1"
- // value_max="1"
-
+ // value_max="1"\r
+
foreach (KeyValuePair<string, BoneDeform> kvp in vpx.BoneDeforms)
- {
- skel.scalebone(kvp.Key, Vector3.One + (kvp.Value.scale *value));
- skel.offsetbone(kvp.Key, kvp.Value.offset * value);
+ {\r
+ skel.scalebone(kvp.Key, Vector3.One + (kvp.Value.scale * value));
+ // skel.offsetbone(kvp.Key, kvp.Value.offset * value);
}
return;
}
}
}
- }
- else
- {
- Logger.Log("Invalid paramater " + param.ToString(), Helpers.LogLevel.Warning);
- }
+
}
public void morph(Avatar av)
foreach (GLMesh mesh in _meshes.Values)
{
mesh.resetallmorphs();
- }
+ }\r
+\r
+ skel.resetbonescales();
foreach (byte vpvalue in av.VisualParameters)
{
public skeleton()
{
-
-
mBones = new Dictionary<string, Bone>();
foreach (Bone src in Bone.mBones.Values)
mLeftEye = mBones["mEyeLeft"];
mRightEye = mBones["mEyeRight"];
+ }\r
+\r
+ public void resetbonescales()\r
+ {\r
+ foreach (KeyValuePair<string,Bone> src in mBones)\r
+ {\r
+ src.Value.scale = new Vector3(1, 1, 1);\r
+ }\r
}
public void deformbone(string name, Vector3 pos, Quaternion rotation)
public void scalebone(string name, Vector3 scale)
{
+
Bone bone;
if (mBones.TryGetValue(name, out bone))
- {
+ {\r
+ Logger.Log(String.Format("scalebone() {0} {1}", name, scale.ToString()),Helpers.LogLevel.Info);
bone.scalebone(scale);
}
}
public void scalebone(Vector3 scale)
{
- //this.scale = Bone.mBones[name].orig_scale + scale;
- this.scale = scale;
+ // this.scale = Bone.mBones[name].orig_scale * scale;
+ this.scale *= scale;
markdirty();
}
{
Quaternion totalrot = getParentRot(); // we don't want this joints rotation included
Vector3 parento = parent.getOffset();
- mTotalPos = parento + pos * scale * totalrot;
+ mTotalPos = parento + pos * parent.scale * totalrot;
Vector3 orig = getOrigOffset();
mDeltaPos = mTotalPos - orig;
else
{
Vector3 orig = getOrigOffset();
- mTotalPos = (pos * scale)+offset_pos;
+ //mTotalPos = (pos * scale)+offset_pos;\r
+ mTotalPos = (pos) + offset_pos;
mDeltaPos = mTotalPos - orig;
posdirty = false;
return mTotalPos;
static public Dictionary<int, VisualParamEx> allParams = new Dictionary<int, VisualParamEx>();
static public Dictionary<int, VisualParamEx> deformParams = new Dictionary<int, VisualParamEx>();
- static public Dictionary<int, VisualParamEx> morphParams = new Dictionary<int, VisualParamEx>();
+
+ //static public Dictionary<int, VisualParamEx> morphParams = new Dictionary<int, VisualParamEx>();\r
+\r
+ //dirty use of string as indexer, we need to have an enum for meshes\r
+ static public Dictionary<string,Dictionary<int, VisualParamEx>> morphParams = new Dictionary<string,Dictionary<int, VisualParamEx>>();
+
static public Dictionary<int, VisualParamEx> drivenParams = new Dictionary<int, VisualParamEx>();
static public SortedList tweakable_params = new SortedList();
public Dictionary<string, BoneDeform> BoneDeforms = null;
public Dictionary<string, VolumeDeform> VolumeDeforms = null;
- public List<driven> childparams = null;
+ public List<driven> childparams = null;\r
+\r
+ public List<VisualParamEx> identicalIds = new List<VisualParamEx>();
public string morphmesh = null;
//TODO other paramaters but these arew concerned with editing the GUI display so not too fussed at the moment
- try
- {
- allParams.Add(ParamID, this);
+ if(allParams.ContainsKey(ParamID))
+ {\r
+ //Logger.Log("Duplicate VisualParam in allParams id " + ParamID.ToString(), Helpers.LogLevel.Info);\r
+ allParams[ParamID].identicalIds.Add(this);
}
- catch
+ else
{
- Logger.Log("Duplicate VisualParam in allParams id " + ParamID.ToString(), Helpers.LogLevel.Info);
+ allParams.Add(ParamID, this);
}
+
if (pt == ParamType.TYPE_BONEDEFORM)
{
// If we are in the skeleton section then we also have bone deforms to parse
ParseVolumeDeforms(node.ChildNodes[0].ChildNodes);
}
+ /*
try
- {
- morphParams.Add(ParamID, this);
+ {\r
+ if (!morphParams.ContainsKey(meshname))\r
+ {\r
+ morphParams.Add(meshname, new Dictionary<int, VisualParamEx>());\r
+ }\r
+ else\r
+ {\r
+ morphParams[meshname].Add(ParamID, this);\r
+ }
}
catch
{
Logger.Log("Duplicate VisualParam in morphParams id " + ParamID.ToString(), Helpers.LogLevel.Info);
}
+ */
}
-//
-// Radegast Metaverse Client
-// Copyright (c) 2009-2012, Radegast Development Team
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-//
-// * Redistributions of source code must retain the above copyright notice,
-// this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-// * Neither the name of the application "Radegast", nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
-// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// $Id$
-//
-
-using System;
-using OpenMetaverse;
-using OpenMetaverse.Rendering;
-
-namespace Radegast.Rendering
-{
- public static class RenderSettings
- {
- #region VBO support
- public static bool UseVBO;
- public static bool CoreVBOPresent;
- public static bool ARBVBOPresent;
- #endregion VBO support
-
- #region Occlusion queries
- /// <summary>Should we try to optimize by not drawing objects occluded behind other objects</summary>
- public static bool OcclusionCullingEnabled;
- public static bool CoreQuerySupported;
- public static bool ARBQuerySupported;
- #endregion Occlusion queries
-
- public static bool HasMultiTexturing;
- public static bool UseFBO;
- public static bool HasMipmap;
- public static bool HasShaders;
- public static DetailLevel PrimRenderDetail = DetailLevel.High;
- public static DetailLevel SculptRenderDetail = DetailLevel.High;
- public static DetailLevel MeshRenderDetail = DetailLevel.Highest;
- public static bool AllowQuickAndDirtyMeshing = true;
- public static int MeshesPerFrame = 2;
- public static int TexturesToDownloadPerFrame = 2;
- /// <summary>Should we try to make sure that large prims that are > our draw distance are in view when we are standing on them</summary>
- public static bool HeavierDistanceChecking = true;
- /// <summary>Minimum time between rebuilding terrain mesh and texture</summary>
- public static float MinimumTimeBetweenTerrainUpdated = 15f;
- /// <summary>Are textures that don't have dimensions that are powers of two supported</summary>
- public static bool TextureNonPowerOfTwoSupported;
-
- /// <summary>
- /// Render avatars
- /// </summary>
- public static bool AvatarRenderingEnabled = true;
-
- /// <summary>
- /// Render prims
- /// </summary>
- public static bool PrimitiveRenderingEnabled = true;
-
- /// <summary>
- /// Show avatar skeloton
- /// </summary>
- public static bool RenderAvatarSkeleton = false;
-
- /// <summary>
- /// Enable shader for shiny
- /// </summary>
- public static bool EnableShiny = false;
-
- #region Water
- public static bool WaterReflections = false;
- #endregion Water
- }
-}
+// \r
+// Radegast Metaverse Client\r
+// Copyright (c) 2009-2012, Radegast Development Team\r
+// All rights reserved.\r
+// \r
+// Redistribution and use in source and binary forms, with or without\r
+// modification, are permitted provided that the following conditions are met:\r
+// \r
+// * Redistributions of source code must retain the above copyright notice,\r
+// this list of conditions and the following disclaimer.\r
+// * Redistributions in binary form must reproduce the above copyright\r
+// notice, this list of conditions and the following disclaimer in the\r
+// documentation and/or other materials provided with the distribution.\r
+// * Neither the name of the application "Radegast", nor the names of its\r
+// contributors may be used to endorse or promote products derived from\r
+// this software without specific prior written permission.\r
+// \r
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"\r
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\r
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\r
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\r
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\r
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\r
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\r
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\r
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\r
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
+//\r
+// $Id$\r
+//\r
+\r
+using System;\r
+using OpenMetaverse;\r
+using OpenMetaverse.Rendering;\r
+\r
+namespace Radegast.Rendering\r
+{\r
+ public static class RenderSettings\r
+ {\r
+ #region VBO support\r
+ public static bool UseVBO;\r
+ public static bool CoreVBOPresent;\r
+ public static bool ARBVBOPresent;\r
+ #endregion VBO support\r
+\r
+ #region Occlusion queries\r
+ /// <summary>Should we try to optimize by not drawing objects occluded behind other objects</summary>\r
+ public static bool OcclusionCullingEnabled;\r
+ public static bool CoreQuerySupported;\r
+ public static bool ARBQuerySupported;\r
+ #endregion Occlusion queries\r
+\r
+ public static bool HasMultiTexturing;\r
+ public static bool UseFBO;\r
+ public static bool HasMipmap;\r
+ public static bool HasShaders;\r
+ public static DetailLevel PrimRenderDetail = DetailLevel.High;\r
+ public static DetailLevel SculptRenderDetail = DetailLevel.High;\r
+ public static DetailLevel MeshRenderDetail = DetailLevel.Highest;\r
+ public static bool AllowQuickAndDirtyMeshing = true;\r
+ public static int MeshesPerFrame = 2;\r
+ public static int TexturesToDownloadPerFrame = 2;\r
+ /// <summary>Should we try to make sure that large prims that are > our draw distance are in view when we are standing on them</summary>\r
+ public static bool HeavierDistanceChecking = true;\r
+ /// <summary>Minimum time between rebuilding terrain mesh and texture</summary>\r
+ public static float MinimumTimeBetweenTerrainUpdated = 15f;\r
+ /// <summary>Are textures that don't have dimensions that are powers of two supported</summary>\r
+ public static bool TextureNonPowerOfTwoSupported;\r
+\r
+ /// <summary>\r
+ /// Render avatars\r
+ /// </summary>\r
+ public static bool AvatarRenderingEnabled = true;\r
+\r
+ /// <summary>\r
+ /// Render prims\r
+ /// </summary>\r
+ public static bool PrimitiveRenderingEnabled = true;\r
+\r
+ /// <summary>\r
+ /// Show avatar skeloton\r
+ /// </summary>\r
+ public static bool RenderAvatarSkeleton = true;\r
+\r
+ /// <summary>\r
+ /// Enable shader for shiny\r
+ /// </summary>\r
+ public static bool EnableShiny = false;\r
+\r
+ #region Water\r
+ public static bool WaterReflections = false;\r
+ #endregion Water\r
+ }\r
+}\r