From b16abc8166c29585cb76cc55c3bdd76e5833cb4f Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Thu, 5 Jan 2017 19:07:37 +0000 Subject: Massive tab and trailing space cleanup --- .../PhysicsModules/ubOdeMeshing/Meshmerizer.cs | 58 +++++++++++----------- 1 file changed, 29 insertions(+), 29 deletions(-) (limited to 'OpenSim/Region/PhysicsModules/ubOdeMeshing/Meshmerizer.cs') diff --git a/OpenSim/Region/PhysicsModules/ubOdeMeshing/Meshmerizer.cs b/OpenSim/Region/PhysicsModules/ubOdeMeshing/Meshmerizer.cs index 7f0713a..163f439 100644 --- a/OpenSim/Region/PhysicsModules/ubOdeMeshing/Meshmerizer.cs +++ b/OpenSim/Region/PhysicsModules/ubOdeMeshing/Meshmerizer.cs @@ -58,8 +58,8 @@ namespace OpenSim.Region.PhysicsModule.ubODEMeshing // Setting baseDir to a path will enable the dumping of raw files // raw files can be imported by blender so a visual inspection of the results can be done - private bool m_Enabled = false; - + private bool m_Enabled = false; + public static object diskLock = new object(); public bool doMeshFileCache = true; @@ -120,7 +120,7 @@ namespace OpenSim.Region.PhysicsModule.ubODEMeshing } CacheExpire = TimeSpan.FromHours(fcache); - + lock (diskLock) { if(doMeshFileCache && cachePath != "") @@ -165,9 +165,9 @@ namespace OpenSim.Region.PhysicsModule.ubODEMeshing if (!m_Enabled) return; } - + #endregion - + /// /// creates a simple box mesh of the specified size. This mesh is of very low vertex count and may /// be useful as a backup proxy when level of detail is not needed or when more complex meshes fail @@ -266,7 +266,7 @@ namespace OpenSim.Region.PhysicsModule.ubODEMeshing private void AddSubMesh(OSDMap subMeshData, List coords, List faces) { // Console.WriteLine("subMeshMap for {0} - {1}", primName, Util.GetFormattedXml((OSD)subMeshMap)); - + // As per http://wiki.secondlife.com/wiki/Mesh/Mesh_Asset_Format, some Mesh Level // of Detail Blocks (maps) contain just a NoGeometry key to signal there is no // geometry for this submesh. @@ -294,15 +294,15 @@ namespace OpenSim.Region.PhysicsModule.ubODEMeshing ushort uX = Utils.BytesToUInt16(posBytes, i); ushort uY = Utils.BytesToUInt16(posBytes, i + 2); ushort uZ = Utils.BytesToUInt16(posBytes, i + 4); - + Coord c = new Coord( Utils.UInt16ToFloat(uX, posMin.X, posMax.X), Utils.UInt16ToFloat(uY, posMin.Y, posMax.Y), Utils.UInt16ToFloat(uZ, posMin.Z, posMax.Z)); - + coords.Add(c); } - + byte[] triangleBytes = subMeshData["TriangleList"].AsBinary(); for (int i = 0; i < triangleBytes.Length; i += 6) { @@ -448,7 +448,7 @@ namespace OpenSim.Region.PhysicsModule.ubODEMeshing if (physicsParms != null) usemesh = true; } - + if(!usemesh && (map.ContainsKey("physics_convex"))) physicsParms = (OSDMap)map["physics_convex"]; @@ -488,9 +488,9 @@ namespace OpenSim.Region.PhysicsModule.ubODEMeshing byte[] decompressedBuf = outMs.GetBuffer(); - decodedMeshOsd = OSDParser.DeserializeLLSDBinary(decompressedBuf); + decodedMeshOsd = OSDParser.DeserializeLLSDBinary(decompressedBuf); } - } + } } } catch (Exception e) @@ -622,7 +622,7 @@ namespace OpenSim.Region.PhysicsModule.ubODEMeshing faces.Add(f); } vertsoffset += vs.Count; - vs.Clear(); + vs.Clear(); continue; } /* @@ -648,7 +648,7 @@ namespace OpenSim.Region.PhysicsModule.ubODEMeshing c.Z = hullr.Vertices[i].z; coords.Add(c); } - + for (i = 0; i < nindexs; i += 3) { t1 = hullr.Indices[i]; @@ -687,7 +687,7 @@ namespace OpenSim.Region.PhysicsModule.ubODEMeshing c.Z = vs[i].z; coords.Add(c); } - + for (i = 0; i < nindexs; i += 3) { t1 = indices[i]; @@ -707,12 +707,12 @@ namespace OpenSim.Region.PhysicsModule.ubODEMeshing } } if (coords.Count > 0 && faces.Count > 0) - return true; + return true; } else { // if neither mesh or decomposition present, warn and use convex - m_log.WarnFormat("[MESH]: Data for PRIM shape type ( mesh or decomposition) not found for prim {0}",primName); + m_log.WarnFormat("[MESH]: Data for PRIM shape type ( mesh or decomposition) not found for prim {0}",primName); } } vs.Clear(); @@ -947,7 +947,7 @@ namespace OpenSim.Region.PhysicsModule.ubODEMeshing { PrimMesh primMesh; coords = new List(); - faces = new List(); + faces = new List(); float pathShearX = primShape.PathShearX < 128 ? (float)primShape.PathShearX * 0.01f : (float)(primShape.PathShearX - 256) * 0.01f; float pathShearY = primShape.PathShearY < 128 ? (float)primShape.PathShearY * 0.01f : (float)(primShape.PathShearY - 256) * 0.01f; @@ -975,7 +975,7 @@ namespace OpenSim.Region.PhysicsModule.ubODEMeshing profileHollow = 0.0f; else if (profileHollow > 0.95f) profileHollow = 0.95f; - + int sides = 4; LevelOfDetail iLOD = (LevelOfDetail)lod; byte profshape = (byte)(primShape.ProfileCurve & 0x07); @@ -1033,7 +1033,7 @@ namespace OpenSim.Region.PhysicsModule.ubODEMeshing } primMesh = new PrimMesh(sides, profileBegin, profileEnd, profileHollow, hollowSides); - + if (primMesh.errorMessage != null) if (primMesh.errorMessage.Length > 0) m_log.Error("[ERROR] " + primMesh.errorMessage); @@ -1162,7 +1162,7 @@ namespace OpenSim.Region.PhysicsModule.ubODEMeshing for (int i = 0; i < someBytes.Length; i++) hash = mdjb2(hash, someBytes[i]); hash = hash << 8; - } + } if (convex) hash |= 4; @@ -1204,7 +1204,7 @@ namespace OpenSim.Region.PhysicsModule.ubODEMeshing { return CreateMesh(primName, primShape, size, lod, false, false, false); } - + public IMesh GetMesh(String primName, PrimitiveBaseShape primShape, Vector3 size, float lod, bool isPhysical, bool convex) { Mesh mesh = null; @@ -1245,7 +1245,7 @@ namespace OpenSim.Region.PhysicsModule.ubODEMeshing } private static Vector3 m_MeshUnitSize = new Vector3(1.0f, 1.0f, 1.0f); - + public IMesh CreateMesh(String primName, PrimitiveBaseShape primShape, Vector3 size, float lod, bool isPhysical, bool convex, bool forOde) { #if SPAM @@ -1348,7 +1348,7 @@ namespace OpenSim.Region.PhysicsModule.ubODEMeshing m_uniqueMeshes.Add(key, mesh); } catch { } - } + } return mesh; } @@ -1380,7 +1380,7 @@ namespace OpenSim.Region.PhysicsModule.ubODEMeshing m_uniqueReleasedMeshes.Add(mesh.Key, mesh); } catch { } - } + } } } @@ -1447,7 +1447,7 @@ namespace OpenSim.Region.PhysicsModule.ubODEMeshing // BinaryFormatter bformatter = new BinaryFormatter(); mesh = Mesh.FromStream(stream,key); } - + } catch (Exception e) { @@ -1524,7 +1524,7 @@ namespace OpenSim.Region.PhysicsModule.ubODEMeshing } } } - + public void ExpireFileCache() { if (!doCacheExpire) @@ -1543,8 +1543,8 @@ namespace OpenSim.Region.PhysicsModule.ubODEMeshing int ndirs = 0; DateTime OlderTime = File.GetLastAccessTimeUtc(controlfile) - CacheExpire; File.SetLastAccessTimeUtc(controlfile, DateTime.UtcNow); - - foreach (string dir in Directory.GetDirectories(cachePath)) + + foreach (string dir in Directory.GetDirectories(cachePath)) { try { -- cgit v1.1