From: Latif Khalifa Date: Tue, 28 Jun 2011 04:40:02 +0000 (+0000) Subject: Avoid looking up in the whole sim Dictionary. X-Git-Tag: 2.8~454 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=a9ead4e337d5cfd971eea50a4f5c5a52adbba9d8;p=radegast%2Fradegast.git Avoid looking up in the whole sim Dictionary. Disable vsync. git-svn-id: https://radegast.googlecode.com/svn/trunk@908 f7a694da-4d33-11de-9ad6-1127a62b9fcd --- diff --git a/Radegast/GUI/Rendering/Rendering.cs b/Radegast/GUI/Rendering/Rendering.cs index affad93..99a6a9c 100644 --- a/Radegast/GUI/Rendering/Rendering.cs +++ b/Radegast/GUI/Rendering/Rendering.cs @@ -296,6 +296,7 @@ namespace Radegast glControl.Load += new EventHandler(glControl_Load); glControl.Disposed += new EventHandler(glControl_Disposed); glControl.Dock = DockStyle.Fill; + glControl.VSync = false; Controls.Add(glControl); glControl.BringToFront(); } @@ -616,7 +617,7 @@ namespace Radegast { Client.Network.CurrentSim.ObjectsPrimitives.FindAll((Primitive root) => root.ParentID == 0).ForEach((Primitive mainPrim) => { - UpdatePrimBlocking(Client.Network.CurrentSim.ObjectsPrimitives[mainPrim.LocalID]); + UpdatePrimBlocking(mainPrim); Client.Network.CurrentSim.ObjectsPrimitives.FindAll((Primitive p) => { return p.ParentID == mainPrim.LocalID; }) .FindAll((Primitive child) => child.ParentID == mainPrim.LocalID) .ForEach((Primitive subPrim) => UpdatePrimBlocking(subPrim)); @@ -671,10 +672,10 @@ namespace Radegast } else { - Primitive parent; - if (Client.Network.CurrentSim.ObjectsPrimitives.TryGetValue(prim.ParentID, out parent)) + FacetedMesh parent; + if (Prims.TryGetValue(prim.ParentID, out parent)) { - return parent.Position + prim.Position * Matrix4.CreateFromQuaternion(parent.Rotation); + return parent.Prim.Position + prim.Position * Matrix4.CreateFromQuaternion(parent.Prim.Rotation); //return parent.Position * prim.Position * prim.Rotation; } else @@ -773,8 +774,8 @@ namespace Radegast { primNr++; Primitive prim = mesh.Prim; - Primitive parent = null; - if (prim.ParentID != 0 && !Client.Network.CurrentSim.ObjectsPrimitives.TryGetValue(prim.ParentID, out parent)) continue; + FacetedMesh parent = null; + if (prim.ParentID != 0 && !Prims.TryGetValue(prim.ParentID, out parent)) continue; // Individual prim matrix GL.PushMatrix(); @@ -782,8 +783,8 @@ namespace Radegast if (prim.ParentID != 0) { // Apply prim translation and rotation relative to the root prim - GL.MultMatrix(Math3D.CreateTranslationMatrix(parent.Position)); - GL.MultMatrix(Math3D.CreateRotationMatrix(parent.Rotation)); + GL.MultMatrix(Math3D.CreateTranslationMatrix(parent.Prim.Position)); + GL.MultMatrix(Math3D.CreateRotationMatrix(parent.Prim.Rotation)); } // Prim roation and position @@ -1049,7 +1050,7 @@ namespace Radegast } else { - mesh = renderer.GenerateFacetedMesh(prim, DetailLevel.Highest); + mesh = renderer.GenerateFacetedMesh(prim, DetailLevel.High); } } catch