/// <summary>\r
/// List of prims in the scene\r
/// </summary>\r
- Dictionary<uint, FacetedMesh> Prims = new Dictionary<uint, FacetedMesh>();\r
-\r
+ Dictionary<uint, RenderPrimitive> Prims = new Dictionary<uint, RenderPrimitive>();\r
+ List<RenderPrimitive> SortedPrims;\r
Dictionary<uint, RenderAvatar> Avatars = new Dictionary<uint, RenderAvatar>();\r
\r
#endregion Public fields\r
double lastFrameTime = 0d;\r
double advTimerTick = 0d;\r
float minLODFactor = 0.005f;\r
- float timeToFocus = 0.3f;\r
\r
float[] lightPos = new float[] { 128f, 128f, 5000f, 0f };\r
float ambient = 0.26f;\r
}\r
else\r
{\r
- FacetedMesh parent;\r
+ RenderPrimitive parent;\r
RenderAvatar parentav;\r
if (Prims.TryGetValue(prim.ParentID, out parent))\r
{\r
lock (Prims)\r
{\r
int primNr = 0;\r
- foreach (FacetedMesh mesh in Prims.Values)\r
+ foreach (RenderPrimitive mesh in Prims.Values)\r
{\r
primNr++;\r
Primitive prim = mesh.Prim;\r
GL.EnableClientState(ArrayCap.NormalArray);\r
\r
int primNr = 0;\r
- foreach (FacetedMesh mesh in Prims.Values)\r
+ foreach (RenderPrimitive mesh in Prims.Values)\r
{\r
primNr++;\r
Primitive prim = mesh.Prim;\r
- FacetedMesh parent = null;\r
+ RenderPrimitive parent = null;\r
RenderAvatar parentav = null;\r
\r
if (prim.ParentID != 0 && !Prims.TryGetValue(prim.ParentID, out parent) && !Avatars.TryGetValue(prim.ParentID, out parentav)) continue;\r
}\r
}\r
\r
- private void MeshPrim(Primitive prim, FacetedMesh mesh)\r
+ private void MeshPrim(Primitive prim, RenderPrimitive mesh)\r
{\r
- FacetedMesh existingMesh = null;\r
+ RenderPrimitive existingMesh = null;\r
\r
lock (Prims)\r
{\r
)\r
{\r
FaceData existingData = (FaceData)existingMesh.Faces[j].UserData;\r
- data.TextureInfo.TexturePointer = existingData.TextureInfo.TexturePointer;\r
+ data.TextureInfo = existingData.TextureInfo;\r
}\r
else\r
{\r
// Regular prim\r
if (prim.Sculpt == null || prim.Sculpt.SculptTexture == UUID.Zero)\r
{\r
- MeshPrim(prim, renderer.GenerateFacetedMesh(prim, DetailLevel.High));\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
else\r
{\r
\r
if (mesh != null)\r
{\r
- MeshPrim(prim, mesh);\r
+ RenderPrimitive rPrim = new RenderPrimitive();\r
+ rPrim.Faces = mesh.Faces;\r
+ rPrim.Prim = prim;\r
+ MeshPrim(prim, rPrim);\r
}\r
}\r
catch\r