this.components = new System.ComponentModel.Container();\r
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(SceneWindow));\r
this.gbZoom = new System.Windows.Forms.GroupBox();\r
+ this.lblDrawDistance = new System.Windows.Forms.Label();\r
this.tbDrawDistance = new System.Windows.Forms.TrackBar();\r
this.button_driver = new System.Windows.Forms.Button();\r
this.textBox_driveramount = new System.Windows.Forms.TextBox();\r
this.takeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();\r
this.returnToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();\r
this.deleteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();\r
- this.lblDrawDistance = new System.Windows.Forms.Label();\r
+ this.cbMisc = new System.Windows.Forms.CheckBox();\r
this.gbZoom.SuspendLayout();\r
((System.ComponentModel.ISupportInitialize)(this.tbDrawDistance)).BeginInit();\r
this.ctxObjects.SuspendLayout();\r
// \r
// gbZoom\r
// \r
+ this.gbZoom.Controls.Add(this.cbMisc);\r
this.gbZoom.Controls.Add(this.lblDrawDistance);\r
this.gbZoom.Controls.Add(this.tbDrawDistance);\r
this.gbZoom.Controls.Add(this.button_driver);\r
this.gbZoom.TabStop = false;\r
this.gbZoom.Enter += new System.EventHandler(this.gbZoom_Enter);\r
// \r
+ // lblDrawDistance\r
+ // \r
+ this.lblDrawDistance.AutoSize = true;\r
+ this.lblDrawDistance.Location = new System.Drawing.Point(542, 140);\r
+ this.lblDrawDistance.Name = "lblDrawDistance";\r
+ this.lblDrawDistance.Size = new System.Drawing.Size(93, 13);\r
+ this.lblDrawDistance.TabIndex = 48;\r
+ this.lblDrawDistance.Text = "Draw distance: 48";\r
+ this.lblDrawDistance.TextAlign = System.Drawing.ContentAlignment.TopRight;\r
+ // \r
// tbDrawDistance\r
// \r
this.tbDrawDistance.Location = new System.Drawing.Point(358, 117);\r
this.deleteToolStripMenuItem.Text = "Delete";\r
this.deleteToolStripMenuItem.Click += new System.EventHandler(this.deleteToolStripMenuItem_Click);\r
// \r
- // lblDrawDistance\r
+ // cbMisc\r
// \r
- this.lblDrawDistance.AutoSize = true;\r
- this.lblDrawDistance.Location = new System.Drawing.Point(542, 140);\r
- this.lblDrawDistance.Name = "lblDrawDistance";\r
- this.lblDrawDistance.Size = new System.Drawing.Size(93, 13);\r
- this.lblDrawDistance.TabIndex = 48;\r
- this.lblDrawDistance.Text = "Draw distance: 48";\r
- this.lblDrawDistance.TextAlign = System.Drawing.ContentAlignment.TopRight;\r
+ this.cbMisc.AutoSize = true;\r
+ this.cbMisc.Checked = true;\r
+ this.cbMisc.CheckState = System.Windows.Forms.CheckState.Checked;\r
+ this.cbMisc.Location = new System.Drawing.Point(358, 142);\r
+ this.cbMisc.Name = "cbMisc";\r
+ this.cbMisc.Size = new System.Drawing.Size(48, 17);\r
+ this.cbMisc.TabIndex = 49;\r
+ this.cbMisc.Text = "Misc";\r
+ this.cbMisc.UseVisualStyleBackColor = true;\r
+ this.cbMisc.CheckedChanged += new System.EventHandler(this.cbMisc_CheckedChanged);\r
// \r
// SceneWindow\r
// \r
private System.Windows.Forms.ComboBox comboBox_driver;\r
private System.Windows.Forms.TrackBar tbDrawDistance;\r
private System.Windows.Forms.Label lblDrawDistance;\r
+ private System.Windows.Forms.CheckBox cbMisc;\r
\r
}\r
}\r
return pos;\r
}\r
\r
- SceneObject GetParent(uint localID)\r
+ SceneObject GetSceneObject(uint localID)\r
{\r
RenderPrimitive parent;\r
RenderAvatar avi;\r
pos = new Vector3(99999f, 99999f, 99999f);\r
rot = Quaternion.Identity;\r
\r
- SceneObject p = GetParent(prim.ParentID);\r
+ SceneObject p = GetSceneObject(prim.ParentID);\r
if (p == null) return;\r
\r
Vector3 parentPos;\r
Quaternion parentRot;\r
- if (p.PositionUpdated)\r
+ if (p.PositionCalculated)\r
{\r
parentPos = p.SimPosition;\r
parentRot = p.SimRotation;\r
p.SimPosition = parentPos;\r
p.SimRotation = parentRot;\r
p.DistanceSquared = Vector3.DistanceSquared(Camera.RenderPosition, p.SimPosition);\r
- p.PositionUpdated = true;\r
+ p.PositionCalculated = true;\r
}\r
\r
if (p is RenderPrimitive)\r
{\r
lock (Avatars)\r
{\r
- if (Vector3.Distance(PrimPos(av), Client.Self.SimPosition) > 32) return;\r
+ if (Vector3.Distance(PrimPos(av), Client.Self.SimPosition) > DrawDistance) return;\r
\r
if (Avatars.ContainsKey(av.LocalID))\r
{\r
\r
void RenderPrim(RenderPrimitive mesh, RenderPass pass, int primNr)\r
{\r
+ // Do the stuff we need to do the first time we encouter the object\r
+ if (!mesh.Initialized) mesh.Initialize();\r
+\r
+ // Do any position interpolation\r
+ mesh.Step(lastFrameTime);\r
+\r
Primitive prim = mesh.Prim;\r
\r
// Individual prim matrix\r
GL.PushMatrix();\r
\r
// Prim roation and position\r
- GL.MultMatrix(Math3D.CreateTranslationMatrix(mesh.SimPosition));\r
- GL.MultMatrix(Math3D.CreateRotationMatrix(mesh.SimRotation));\r
+ GL.MultMatrix(Math3D.CreateTranslationMatrix(mesh.RenderPosition));\r
+ GL.MultMatrix(Math3D.CreateRotationMatrix(mesh.RenderRotation));\r
\r
// Prim scaling\r
GL.Scale(prim.Scale.X, prim.Scale.Y, prim.Scale.Z);\r
Face face = mesh.Faces[j];\r
FaceData data = (FaceData)mesh.Faces[j].UserData;\r
\r
+ if (data == null)\r
+ continue;\r
+\r
if (teFace == null)\r
teFace = mesh.Prim.Textures.DefaultTexture;\r
\r
\r
foreach (SceneObject obj in SortedObjects)\r
{\r
- obj.PositionUpdated = false;\r
+ obj.PositionCalculated = false;\r
}\r
\r
foreach (SceneObject obj in SortedObjects)\r
{\r
- if (!obj.PositionUpdated)\r
+ if (!obj.PositionCalculated)\r
{\r
PrimPosAndRot(obj.BasePrim, out obj.SimPosition, out obj.SimRotation);\r
obj.DistanceSquared = Vector3.DistanceSquared(Camera.RenderPosition, obj.SimPosition);\r
- obj.PositionUpdated = true;\r
+ obj.PositionCalculated = true;\r
}\r
}\r
\r
\r
if (prim.Textures == null) return;\r
\r
+ RenderPrimitive rPrim = null;\r
+ if (!Prims.TryGetValue(prim.LocalID, out rPrim))\r
+ {\r
+ rPrim = new RenderPrimitive();\r
+ }\r
+\r
// Regular prim\r
if (prim.Sculpt == null || prim.Sculpt.SculptTexture == UUID.Zero)\r
{\r
FacetedMesh mesh = renderer.GenerateFacetedMesh(prim, DetailLevel.High);\r
- RenderPrimitive rPrim = new RenderPrimitive();\r
rPrim.Faces = mesh.Faces;\r
rPrim.Prim = prim;\r
MeshPrim(prim, rPrim);\r
\r
if (mesh != null)\r
{\r
- RenderPrimitive rPrim = new RenderPrimitive();\r
rPrim.Faces = mesh.Faces;\r
rPrim.Prim = prim;\r
MeshPrim(prim, rPrim);\r
UpdateCamera();\r
}\r
\r
+ bool miscEnabled = true;\r
+ private void cbMisc_CheckedChanged(object sender, EventArgs e)\r
+ {\r
+ miscEnabled = cbMisc.Checked;\r
+ }\r
+\r
\r
}\r
}\r
Avatar,\r
}\r
\r
- public abstract class SceneObject: IComparable\r
+ /// <summary>\r
+ /// Base class for all scene objects\r
+ /// </summary>\r
+ public abstract class SceneObject : IComparable, IDisposable\r
{\r
+ /// <summary>Actual position of the object in the region</summary>\r
public Vector3 SimPosition;\r
+ /// <summary>Actual rotation of the object in the region</summary>\r
public Quaternion SimRotation;\r
+ /// <summary>Rendered position of the object in the region</summary>\r
+ public Vector3 RenderPosition;\r
+ /// <summary>Rendered rotationm of the object in the region</summary>\r
+ public Quaternion RenderRotation;\r
+ /// <summary>Per frame calculated square of the distance from camera</summary>\r
public float DistanceSquared;\r
+ /// <summary>Bounding volume of the object</summary>\r
public BoundingVolume BoundingVolume;\r
- public bool PositionUpdated;\r
+ /// <summary>Was the sim position and distance from camera calculated during this frame</summary>\r
+ public bool PositionCalculated;\r
+ /// <summary>Scene object type</summary>\r
public SceneObjectType Type = SceneObjectType.None;\r
+ /// <summary>Libomv primitive</summary>\r
public virtual Primitive BasePrim { get; set; }\r
+ /// <summary>Were initial initialization tasks done</summary>\r
+ public bool Initialized;\r
+\r
+ /// <summary>\r
+ /// Cleanup resources used\r
+ /// </summary>\r
+ public virtual void Dispose()\r
+ {\r
+ }\r
+\r
+ /// <summary>\r
+ /// Task performed the fist time object is set for rendering\r
+ /// </summary>\r
+ public virtual void Initialize()\r
+ {\r
+ }\r
\r
+ /// <summary>\r
+ /// Perform per frame tasks\r
+ /// </summary>\r
+ /// <param name="time">Time since the last call (last frame time in seconds)</param>\r
+ public virtual void Step(double time)\r
+ {\r
+ }\r
+\r
+ /// <summary>\r
+ /// Implementation of the IComparable interface\r
+ /// used for sorting by distance\r
+ /// </summary>\r
+ /// <param name="other">Object we are comparing to</param>\r
+ /// <returns>Result of the comparison</returns>\r
public virtual int CompareTo(object other)\r
{\r
SceneObject o = (SceneObject)other;\r
}\r
}\r
\r
- public class RenderPrimitive : SceneObject, IDisposable\r
+ public class RenderPrimitive : SceneObject\r
{\r
public Primitive Prim;\r
public List<Face> Faces;\r
Type = SceneObjectType.Primitive;\r
}\r
\r
- public virtual void Dispose()\r
- {\r
- }\r
-\r
public override Primitive BasePrim\r
{\r
get { return Prim; }\r
set { Prim = value; }\r
}\r
\r
+ public override void Initialize()\r
+ {\r
+ RenderPosition = SimPosition;\r
+ RenderRotation = SimRotation;\r
+ Initialized = true;\r
+ }\r
+\r
+ public override void Step(double time)\r
+ {\r
+ if (RenderPosition != SimPosition)\r
+ {\r
+ RenderPosition = RHelp.Smoothed1stOrder(RenderPosition, SimPosition, time);\r
+ }\r
+ if (RenderRotation != SimRotation)\r
+ {\r
+ RenderRotation = SimRotation;\r
+ }\r
+ }\r
+\r
public override string ToString()\r
{\r
uint id = Prim == null ? 0 : Prim.LocalID;\r
float wy = q.W * y2;\r
float wz = q.W * z2;\r
\r
- mat[0] = (1.0f - (yy + zz))*scale.X;\r
- mat[1] = (xy - wz)*scale.X;\r
+ mat[0] = (1.0f - (yy + zz)) * scale.X;\r
+ mat[1] = (xy - wz) * scale.X;\r
mat[2] = (xz + wy) * scale.X;\r
mat[3] = 0.0f;\r
\r
{\r
}\r
\r
- public GLMesh(GLMesh source,GLAvatar av)\r
- :base(source.Name)\r
+ public GLMesh(GLMesh source, GLAvatar av)\r
+ : base(source.Name)\r
{\r
this.av = av;\r
// Make a new GLMesh copy from the supplied source\r
- \r
+\r
RenderData.Vertices = new float[source.RenderData.Vertices.Length];\r
RenderData.Normals = new float[source.RenderData.Normals.Length];\r
RenderData.TexCoords = new float[source.RenderData.TexCoords.Length];\r
RenderData.weights = new float[source.RenderData.weights.Length];\r
RenderData.skinJoints = new string[source.RenderData.skinJoints.Length];\r
\r
- Array.Copy(source.RenderData.Vertices,RenderData.Vertices,source.RenderData.Vertices.Length);\r
+ Array.Copy(source.RenderData.Vertices, RenderData.Vertices, source.RenderData.Vertices.Length);\r
Array.Copy(source.RenderData.Normals, RenderData.Normals, source.RenderData.Normals.Length);\r
\r
Array.Copy(source.RenderData.TexCoords, RenderData.TexCoords, source.RenderData.TexCoords.Length);\r
RenderData.Vertices = new float[_numVertices * 3];\r
RenderData.Normals = new float[_numVertices * 3];\r
\r
- Quaternion quat = Quaternion.CreateFromEulers(0, 0, (float)(Math.PI/4.0));\r
+ Quaternion quat = Quaternion.CreateFromEulers(0, 0, (float)(Math.PI / 4.0));\r
\r
int current = 0;\r
for (int i = 0; i < _numVertices; i++)\r
{\r
\r
- RenderData.Normals[current] = _vertices[i].Normal.X;\r
- RenderData.Vertices[current++] = _vertices[i].Coord.X;\r
- RenderData.Normals[current] = _vertices[i].Normal.Y;\r
- RenderData.Vertices[current++] = _vertices[i].Coord.Y;\r
- RenderData.Normals[current] = _vertices[i].Normal.Z;\r
- RenderData.Vertices[current++] = _vertices[i].Coord.Z;\r
- \r
+ RenderData.Normals[current] = _vertices[i].Normal.X;\r
+ RenderData.Vertices[current++] = _vertices[i].Coord.X;\r
+ RenderData.Normals[current] = _vertices[i].Normal.Y;\r
+ RenderData.Vertices[current++] = _vertices[i].Coord.Y;\r
+ RenderData.Normals[current] = _vertices[i].Normal.Z;\r
+ RenderData.Vertices[current++] = _vertices[i].Coord.Z;\r
+\r
if (_vertices[i].Coord.X < minX)\r
minX = _vertices[i].Coord.X;\r
else if (_vertices[i].Coord.X > maxX)\r
current = 0;\r
for (int i = 0; i < _numVertices; i++)\r
{\r
- RenderData.TexCoords[current++] = _vertices[i].TexCoord.X;\r
- RenderData.TexCoords[current++] = _vertices[i].TexCoord.Y;\r
+ RenderData.TexCoords[current++] = _vertices[i].TexCoord.X;\r
+ RenderData.TexCoords[current++] = _vertices[i].TexCoord.Y;\r
}\r
\r
RenderData.weights = new float[_numVertices];\r
RenderData.weights[i] = _vertices[i].Weight;\r
}\r
\r
- RenderData.skinJoints = new string[_skinJoints.Length+3];\r
+ RenderData.skinJoints = new string[_skinJoints.Length + 3];\r
for (int i = 1; i < _skinJoints.Length; i++)\r
{\r
RenderData.skinJoints[i] = _skinJoints[i];\r
\r
public void applyjointweights()\r
{\r
- \r
+\r
/*Each weight actually contains two pieces of information. \r
* The number to the left of the decimal point is the index of the joint and also \r
* implicitly indexes to the following joint. The actual weight is to the right of \r
* in the list for each of its children.\r
*/\r
\r
- float weight=-9999;\r
- int jointindex=0;\r
+ float weight = -9999;\r
+ int jointindex = 0;\r
float factor;\r
\r
Bone ba = null;\r
Bone bb = null;\r
\r
- for (int v = 0, x=0; v < RenderData.Vertices.Length; v=v+3, x++)\r
+ for (int v = 0, x = 0; v < RenderData.Vertices.Length; v = v + 3, x++)\r
{\r
if (weight != RenderData.weights[x])\r
{\r
factor = RenderData.weights[x] - jointindex;\r
weight = weight - jointindex;\r
\r
- string jointname="", jointname2="";\r
+ string jointname = "", jointname2 = "";\r
\r
if (this.Name == "upperBodyMesh")\r
{\r
{\r
return; // not interested in this mesh\r
}\r
- \r
- \r
+\r
+\r
if (jointname == "")\r
{\r
//Don't yet handle this, its a split joint to two children\r
ba = av.skel.mBones[jointname];\r
}\r
\r
- if(jointname2=="")\r
+ if (jointname2 == "")\r
{\r
- bb=null;\r
+ bb = null;\r
}\r
else\r
{\r
- bb = av.skel.mBones[jointname2]; \r
+ bb = av.skel.mBones[jointname2];\r
}\r
}\r
\r
}\r
else\r
{\r
- lerp = ba.getOffset()- ba.getOrigOffset();\r
+ lerp = ba.getOffset() - ba.getOrigOffset();\r
offset = ba.getOffset();\r
rot = ba.getRotation();\r
}\r
\r
Vector3 pos = new Vector3(MorphRenderData.Vertices[v], MorphRenderData.Vertices[v + 1], MorphRenderData.Vertices[v + 2]);\r
- pos = pos + lerp; \r
+ pos = pos + lerp;\r
pos = pos - offset;\r
pos = pos * rot;\r
pos = pos + offset;\r
- \r
+\r
RenderData.Vertices[v] = pos.X;\r
RenderData.Vertices[v + 1] = pos.Y;\r
RenderData.Vertices[v + 2] = pos.Z;\r
\r
uint i = mvx.VertexIndex;\r
\r
- MorphRenderData.Vertices[i * 3] = OrigRenderData.Vertices[i*3] + mvx.Coord.X * weight;\r
+ MorphRenderData.Vertices[i * 3] = OrigRenderData.Vertices[i * 3] + mvx.Coord.X * weight;\r
MorphRenderData.Vertices[(i * 3) + 1] = OrigRenderData.Vertices[i * 3 + 1] + mvx.Coord.Y * weight;\r
MorphRenderData.Vertices[(i * 3) + 2] = OrigRenderData.Vertices[i * 3 + 2] + mvx.Coord.Z * weight;\r
\r
RenderData.TexCoords[i * 2] = OrigRenderData.TexCoords[i * 2] + mvx.TexCoord.X * weight;\r
RenderData.TexCoords[(i * 2) + 1] = OrigRenderData.TexCoords[i * 2 + 1] + mvx.TexCoord.Y * weight;\r
- \r
+\r
}\r
}\r
}\r
private static Dictionary<string, GLMesh> _defaultmeshes = new Dictionary<string, GLMesh>();\r
public Dictionary<string, GLMesh> _meshes = new Dictionary<string, GLMesh>();\r
\r
- public skeleton skel = new skeleton(); \r
+ public skeleton skel = new skeleton();\r
public static Dictionary<int, attachment_point> attachment_points = new Dictionary<int, attachment_point>();\r
\r
public bool _wireframe = true;\r
\r
public GLAvatar()\r
{\r
- foreach (KeyValuePair<string,GLMesh> kvp in _defaultmeshes)\r
+ foreach (KeyValuePair<string, GLMesh> kvp in _defaultmeshes)\r
{\r
- GLMesh mesh = new GLMesh(kvp.Value,this); // Instance our meshes\r
+ GLMesh mesh = new GLMesh(kvp.Value, this); // Instance our meshes\r
_meshes.Add(kvp.Key, mesh);\r
- \r
+\r
}\r
}\r
\r
public static void dumptweaks()\r
{\r
\r
- for(int x=0;x<VisualParamEx.tweakable_params.Count;x++)\r
+ for (int x = 0; x < VisualParamEx.tweakable_params.Count; x++)\r
{\r
VisualParamEx vpe = (VisualParamEx)VisualParamEx.tweakable_params.GetByIndex(x);\r
- Console.WriteLine(string.Format("{0} is {1}",x,vpe.Name));\r
+ Console.WriteLine(string.Format("{0} is {1}", x, vpe.Name));\r
}\r
\r
\r
public void morphtest(Avatar av, int param, float weight)\r
{\r
VisualParamEx vpx;\r
- if (VisualParamEx.allParams.TryGetValue(param,out vpx))\r
+ if (VisualParamEx.allParams.TryGetValue(param, out vpx))\r
{\r
\r
- Logger.Log(string.Format("Applying visual parameter {0} id {1} value {2}", vpx.Name, vpx.ParamID, weight), Helpers.LogLevel.Info); \r
+ Logger.Log(string.Format("Applying visual parameter {0} id {1} value {2}", vpx.Name, vpx.ParamID, weight), Helpers.LogLevel.Info);\r
\r
//weight = weight * 2.0f;\r
//weight=weight-1.0f;\r
\r
float value = vpx.MinValue + ((vpx.MaxValue - vpx.MinValue) * weight);\r
\r
- \r
+\r
if (vpx.pType == VisualParamEx.ParamType.TYPE_MORPH)\r
{\r
// Its a morph\r
}\r
* */\r
\r
- }\r
- \r
+ }\r
+\r
}\r
else\r
{\r
{\r
foreach (KeyValuePair<string, Vector3> kvp in vpx.BoneDeforms)\r
{\r
- skel.deformbone(kvp.Key, new Vector3(0,0,0),kvp.Value*value,Quaternion.Identity);\r
+ skel.deformbone(kvp.Key, new Vector3(0, 0, 0), kvp.Value * value, Quaternion.Identity);\r
}\r
}\r
else\r
msex = VisualParamEx.EparamSex.SEX_FEMALE;\r
}\r
}\r
- \r
+\r
\r
foreach (byte vpvalue in av.VisualParameters)\r
{\r
- if (vpsent==true && VisualAppearanceParameters[x] == vpvalue)\r
+ if (vpsent == true && VisualAppearanceParameters[x] == vpvalue)\r
{\r
x++;\r
continue;\r
\r
float value = (vpvalue / 255.0f);\r
this.morphtest(av, vpe.ParamID, value);\r
- \r
+\r
x++;\r
}\r
\r
mUpperMeshMapping.Add(14, "mWristRight");\r
mUpperMeshMapping.Add(15, "");\r
\r
- mLowerMeshMapping.Add(1,"mPelvis");\r
+ mLowerMeshMapping.Add(1, "mPelvis");\r
mLowerMeshMapping.Add(2, "mHipRight");\r
mLowerMeshMapping.Add(3, "mKneeRight");\r
mLowerMeshMapping.Add(4, "mAnkleRight");\r
public Vector3 orig_scale;\r
public Vector3 orig_piviot;\r
\r
- Matrix4 mDeformMatrix=Matrix4.Identity;\r
+ Matrix4 mDeformMatrix = Matrix4.Identity;\r
\r
public Bone parent;\r
\r
b.orig_scale = new Vector3(b.scale);\r
\r
\r
- float[] deform = Math3D.CreateSRTMatrix(new Vector3(1,1,1), b.rot, b.orig_pos);\r
+ float[] deform = Math3D.CreateSRTMatrix(new Vector3(1, 1, 1), b.rot, b.orig_pos);\r
b.mDeformMatrix = new Matrix4(deform[0], deform[1], deform[2], deform[3], deform[4], deform[5], deform[6], deform[7], deform[8], deform[9], deform[10], deform[11], deform[12], deform[13], deform[14], deform[15]);\r
\r
//TODO piviot\r
Vector3 parento = parent.getOffset();\r
Vector3 mepre = pos * scale;\r
mepre = mepre * totalrot;\r
- return parento+ mepre;\r
+ return parento + mepre;\r
}\r
else\r
{\r
- return (pos * scale) *getRotation();\r
+ return (pos * scale) * getRotation();\r
}\r
}\r
\r
\r
if (parent != null)\r
{\r
- totalrot = rot* parent.getRotation();\r
+ totalrot = rot * parent.getRotation();\r
}\r
\r
return totalrot;\r
public class VisualParamEx\r
{\r
\r
- static public Dictionary<int,VisualParamEx> allParams = new Dictionary<int,VisualParamEx>();\r
+ static public Dictionary<int, VisualParamEx> allParams = new Dictionary<int, VisualParamEx>();\r
static public Dictionary<int, VisualParamEx> deformParams = new Dictionary<int, VisualParamEx>();\r
static public Dictionary<int, VisualParamEx> morphParams = new Dictionary<int, VisualParamEx>();\r
static public Dictionary<int, VisualParamEx> drivenParams = new Dictionary<int, VisualParamEx>();\r
}\r
\r
public string meshname;\r
- \r
+\r
/// <summary>Index of this visual param</summary>\r
public int ParamID;\r
/// <summary>Internal name</summary>\r
public VisualParamEx(XmlNode node, ParamType pt)\r
{\r
pType = pt;\r
- \r
+\r
ParamID = Int32.Parse(node.Attributes.GetNamedItem("id").Value);\r
Name = node.Attributes.GetNamedItem("name").Value;\r
Group = Int32.Parse(node.Attributes.GetNamedItem("group").Value);\r
\r
//These dont exist for facal expresion morphs\r
- if(node.Attributes.GetNamedItem("wearable")!=null)\r
+ if (node.Attributes.GetNamedItem("wearable") != null)\r
Wearable = node.Attributes.GetNamedItem("wearable").Value;\r
- \r
+\r
MinValue = float.Parse(node.Attributes.GetNamedItem("value_min").Value);\r
MaxValue = float.Parse(node.Attributes.GetNamedItem("value_max").Value);\r
\r
\r
if (Group == (int)GroupType.VISUAL_PARAM_GROUP_TWEAKABLE)\r
{\r
- if(!tweakable_params.ContainsKey(ParamID)) //stupid duplicate shared params\r
+ if (!tweakable_params.ContainsKey(ParamID)) //stupid duplicate shared params\r
{\r
tweakable_params.Add(this.ParamID, this);\r
}\r
- Logger.Log(String.Format("Adding tweakable paramater ID {0} {1}", count, this.Name),Helpers.LogLevel.Info);\r
+ Logger.Log(String.Format("Adding tweakable paramater ID {0} {1}", count, this.Name), Helpers.LogLevel.Info);\r
count++;\r
}\r
\r
{\r
// If we are in the skeleton section then we also have bone deforms to parse\r
BoneDeforms = new Dictionary<string, Vector3>();\r
- if(node.HasChildNodes && node.ChildNodes[0].HasChildNodes)\r
+ if (node.HasChildNodes && node.ChildNodes[0].HasChildNodes)\r
{\r
- ParseBoneDeforms(node.ChildNodes[0].ChildNodes); \r
+ ParseBoneDeforms(node.ChildNodes[0].ChildNodes);\r
}\r
- deformParams.Add(ParamID,this);\r
+ deformParams.Add(ParamID, this);\r
}\r
\r
if (pt == ParamType.TYPE_MORPH)\r
\r
}\r
}\r
- \r
+\r
}\r
\r
void ParseBoneDeforms(XmlNodeList deforms)\r
d.hasMinMax = false;\r
}\r
\r
- childparams.Add(d); \r
- \r
+ childparams.Add(d);\r
+\r
}\r
}\r
}\r