aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Physics/Meshing/Meshmerizer.cs7
1 files changed, 4 insertions, 3 deletions
diff --git a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs
index 72dce6d..1257804 100644
--- a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs
+++ b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs
@@ -349,6 +349,7 @@ namespace OpenSim.Region.Physics.Meshing
349 349
350 OpenMetaverse.Vector3 posMax = ((OSDMap)subMeshMap["PositionDomain"])["Max"].AsVector3(); 350 OpenMetaverse.Vector3 posMax = ((OSDMap)subMeshMap["PositionDomain"])["Max"].AsVector3();
351 OpenMetaverse.Vector3 posMin = ((OSDMap)subMeshMap["PositionDomain"])["Min"].AsVector3(); 351 OpenMetaverse.Vector3 posMin = ((OSDMap)subMeshMap["PositionDomain"])["Min"].AsVector3();
352 ushort faceIndexOffset = (ushort)coords.Count;
352 353
353 byte[] posBytes = subMeshMap["Position"].AsBinary(); 354 byte[] posBytes = subMeshMap["Position"].AsBinary();
354 for (int i = 0; i < posBytes.Length; i += 6) 355 for (int i = 0; i < posBytes.Length; i += 6)
@@ -368,9 +369,9 @@ namespace OpenSim.Region.Physics.Meshing
368 byte[] triangleBytes = subMeshMap["TriangleList"].AsBinary(); 369 byte[] triangleBytes = subMeshMap["TriangleList"].AsBinary();
369 for (int i = 0; i < triangleBytes.Length; i += 6) 370 for (int i = 0; i < triangleBytes.Length; i += 6)
370 { 371 {
371 ushort v1 = Utils.BytesToUInt16(triangleBytes, i); 372 ushort v1 = (ushort)(Utils.BytesToUInt16(triangleBytes, i) + faceIndexOffset);
372 ushort v2 = Utils.BytesToUInt16(triangleBytes, i + 2); 373 ushort v2 = (ushort)(Utils.BytesToUInt16(triangleBytes, i + 2) + faceIndexOffset);
373 ushort v3 = Utils.BytesToUInt16(triangleBytes, i + 4); 374 ushort v3 = (ushort)(Utils.BytesToUInt16(triangleBytes, i + 4) + faceIndexOffset);
374 Face f = new Face(v1, v2, v3); 375 Face f = new Face(v1, v2, v3);
375 faces.Add(f); 376 faces.Add(f);
376 } 377 }