diff options
Diffstat (limited to 'OpenSim/Region/PhysicsModules/Meshing/Meshmerizer/Meshmerizer.cs')
-rw-r--r-- | OpenSim/Region/PhysicsModules/Meshing/Meshmerizer/Meshmerizer.cs | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/OpenSim/Region/PhysicsModules/Meshing/Meshmerizer/Meshmerizer.cs b/OpenSim/Region/PhysicsModules/Meshing/Meshmerizer/Meshmerizer.cs index 0d22e96..4f95554 100644 --- a/OpenSim/Region/PhysicsModules/Meshing/Meshmerizer/Meshmerizer.cs +++ b/OpenSim/Region/PhysicsModules/Meshing/Meshmerizer/Meshmerizer.cs | |||
@@ -247,13 +247,13 @@ namespace OpenSim.Region.PhysicsModule.Meshing | |||
247 | private void AddSubMesh(OSDMap subMeshData, Vector3 size, List<Coord> coords, List<Face> faces) | 247 | private void AddSubMesh(OSDMap subMeshData, Vector3 size, List<Coord> coords, List<Face> faces) |
248 | { | 248 | { |
249 | // Console.WriteLine("subMeshMap for {0} - {1}", primName, Util.GetFormattedXml((OSD)subMeshMap)); | 249 | // Console.WriteLine("subMeshMap for {0} - {1}", primName, Util.GetFormattedXml((OSD)subMeshMap)); |
250 | 250 | ||
251 | // As per http://wiki.secondlife.com/wiki/Mesh/Mesh_Asset_Format, some Mesh Level | 251 | // As per http://wiki.secondlife.com/wiki/Mesh/Mesh_Asset_Format, some Mesh Level |
252 | // of Detail Blocks (maps) contain just a NoGeometry key to signal there is no | 252 | // of Detail Blocks (maps) contain just a NoGeometry key to signal there is no |
253 | // geometry for this submesh. | 253 | // geometry for this submesh. |
254 | if (subMeshData.ContainsKey("NoGeometry") && ((OSDBoolean)subMeshData["NoGeometry"])) | 254 | if (subMeshData.ContainsKey("NoGeometry") && ((OSDBoolean)subMeshData["NoGeometry"])) |
255 | return; | 255 | return; |
256 | 256 | ||
257 | OpenMetaverse.Vector3 posMax = ((OSDMap)subMeshData["PositionDomain"])["Max"].AsVector3(); | 257 | OpenMetaverse.Vector3 posMax = ((OSDMap)subMeshData["PositionDomain"])["Max"].AsVector3(); |
258 | OpenMetaverse.Vector3 posMin = ((OSDMap)subMeshData["PositionDomain"])["Min"].AsVector3(); | 258 | OpenMetaverse.Vector3 posMin = ((OSDMap)subMeshData["PositionDomain"])["Min"].AsVector3(); |
259 | ushort faceIndexOffset = (ushort)coords.Count; | 259 | ushort faceIndexOffset = (ushort)coords.Count; |
@@ -264,15 +264,15 @@ namespace OpenSim.Region.PhysicsModule.Meshing | |||
264 | ushort uX = Utils.BytesToUInt16(posBytes, i); | 264 | ushort uX = Utils.BytesToUInt16(posBytes, i); |
265 | ushort uY = Utils.BytesToUInt16(posBytes, i + 2); | 265 | ushort uY = Utils.BytesToUInt16(posBytes, i + 2); |
266 | ushort uZ = Utils.BytesToUInt16(posBytes, i + 4); | 266 | ushort uZ = Utils.BytesToUInt16(posBytes, i + 4); |
267 | 267 | ||
268 | Coord c = new Coord( | 268 | Coord c = new Coord( |
269 | Utils.UInt16ToFloat(uX, posMin.X, posMax.X) * size.X, | 269 | Utils.UInt16ToFloat(uX, posMin.X, posMax.X) * size.X, |
270 | Utils.UInt16ToFloat(uY, posMin.Y, posMax.Y) * size.Y, | 270 | Utils.UInt16ToFloat(uY, posMin.Y, posMax.Y) * size.Y, |
271 | Utils.UInt16ToFloat(uZ, posMin.Z, posMax.Z) * size.Z); | 271 | Utils.UInt16ToFloat(uZ, posMin.Z, posMax.Z) * size.Z); |
272 | 272 | ||
273 | coords.Add(c); | 273 | coords.Add(c); |
274 | } | 274 | } |
275 | 275 | ||
276 | byte[] triangleBytes = subMeshData["TriangleList"].AsBinary(); | 276 | byte[] triangleBytes = subMeshData["TriangleList"].AsBinary(); |
277 | for (int i = 0; i < triangleBytes.Length; i += 6) | 277 | for (int i = 0; i < triangleBytes.Length; i += 6) |
278 | { | 278 | { |
@@ -436,9 +436,9 @@ namespace OpenSim.Region.PhysicsModule.Meshing | |||
436 | int convexSize = convexBlock["size"].AsInteger(); | 436 | int convexSize = convexBlock["size"].AsInteger(); |
437 | 437 | ||
438 | byte[] convexBytes = new byte[convexSize]; | 438 | byte[] convexBytes = new byte[convexSize]; |
439 | 439 | ||
440 | System.Buffer.BlockCopy(primShape.SculptData, convexOffset, convexBytes, 0, convexSize); | 440 | System.Buffer.BlockCopy(primShape.SculptData, convexOffset, convexBytes, 0, convexSize); |
441 | 441 | ||
442 | try | 442 | try |
443 | { | 443 | { |
444 | convexBlockOsd = DecompressOsd(convexBytes); | 444 | convexBlockOsd = DecompressOsd(convexBytes); |
@@ -449,7 +449,7 @@ namespace OpenSim.Region.PhysicsModule.Meshing | |||
449 | //return false; | 449 | //return false; |
450 | } | 450 | } |
451 | } | 451 | } |
452 | 452 | ||
453 | if (convexBlockOsd != null && convexBlockOsd is OSDMap) | 453 | if (convexBlockOsd != null && convexBlockOsd is OSDMap) |
454 | { | 454 | { |
455 | convexBlock = convexBlockOsd as OSDMap; | 455 | convexBlock = convexBlockOsd as OSDMap; |
@@ -762,7 +762,7 @@ namespace OpenSim.Region.PhysicsModule.Meshing | |||
762 | { | 762 | { |
763 | PrimMesh primMesh; | 763 | PrimMesh primMesh; |
764 | coords = new List<Coord>(); | 764 | coords = new List<Coord>(); |
765 | faces = new List<Face>(); | 765 | faces = new List<Face>(); |
766 | 766 | ||
767 | float pathShearX = primShape.PathShearX < 128 ? (float)primShape.PathShearX * 0.01f : (float)(primShape.PathShearX - 256) * 0.01f; | 767 | float pathShearX = primShape.PathShearX < 128 ? (float)primShape.PathShearX * 0.01f : (float)(primShape.PathShearX - 256) * 0.01f; |
768 | float pathShearY = primShape.PathShearY < 128 ? (float)primShape.PathShearY * 0.01f : (float)(primShape.PathShearY - 256) * 0.01f; | 768 | float pathShearY = primShape.PathShearY < 128 ? (float)primShape.PathShearY * 0.01f : (float)(primShape.PathShearY - 256) * 0.01f; |
@@ -994,7 +994,7 @@ namespace OpenSim.Region.PhysicsModule.Meshing | |||
994 | if ((!isPhysical) && size.X < minSizeForComplexMesh && size.Y < minSizeForComplexMesh && size.Z < minSizeForComplexMesh) | 994 | if ((!isPhysical) && size.X < minSizeForComplexMesh && size.Y < minSizeForComplexMesh && size.Z < minSizeForComplexMesh) |
995 | { | 995 | { |
996 | #if SPAM | 996 | #if SPAM |
997 | m_log.Debug("Meshmerizer: prim " + primName + " has a size of " + size.ToString() + " which is below threshold of " + | 997 | m_log.Debug("Meshmerizer: prim " + primName + " has a size of " + size.ToString() + " which is below threshold of " + |
998 | minSizeForComplexMesh.ToString() + " - creating simple bounding box"); | 998 | minSizeForComplexMesh.ToString() + " - creating simple bounding box"); |
999 | #endif | 999 | #endif |
1000 | mesh = CreateBoundingBoxMesh(mesh); | 1000 | mesh = CreateBoundingBoxMesh(mesh); |