From 9038218c2d67cd796242e17c7e65adbde05c8538 Mon Sep 17 00:00:00 2001 From: dahlia Date: Wed, 20 Oct 2010 20:39:05 -0700 Subject: fix combining of multiple physics submeshes --- OpenSim/Region/Physics/Meshing/Meshmerizer.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'OpenSim/Region/Physics/Meshing') 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 OpenMetaverse.Vector3 posMax = ((OSDMap)subMeshMap["PositionDomain"])["Max"].AsVector3(); OpenMetaverse.Vector3 posMin = ((OSDMap)subMeshMap["PositionDomain"])["Min"].AsVector3(); + ushort faceIndexOffset = (ushort)coords.Count; byte[] posBytes = subMeshMap["Position"].AsBinary(); for (int i = 0; i < posBytes.Length; i += 6) @@ -368,9 +369,9 @@ namespace OpenSim.Region.Physics.Meshing byte[] triangleBytes = subMeshMap["TriangleList"].AsBinary(); for (int i = 0; i < triangleBytes.Length; i += 6) { - ushort v1 = Utils.BytesToUInt16(triangleBytes, i); - ushort v2 = Utils.BytesToUInt16(triangleBytes, i + 2); - ushort v3 = Utils.BytesToUInt16(triangleBytes, i + 4); + ushort v1 = (ushort)(Utils.BytesToUInt16(triangleBytes, i) + faceIndexOffset); + ushort v2 = (ushort)(Utils.BytesToUInt16(triangleBytes, i + 2) + faceIndexOffset); + ushort v3 = (ushort)(Utils.BytesToUInt16(triangleBytes, i + 4) + faceIndexOffset); Face f = new Face(v1, v2, v3); faces.Add(f); } -- cgit v1.1 From c74c1620a15fcf032a074ed2b979a06f2913e08b Mon Sep 17 00:00:00 2001 From: Latif Khalifa Date: Sun, 24 Oct 2010 22:47:53 +0200 Subject: * Updated libomv to r3461 Main reason for upgrade is to revert API change that was introduced in order to support headerless binary LLSD decoding needed for deserialization of the mesh assets, which turned out to be unnecessary as we can transparently decode both kinds. --- OpenSim/Region/Physics/Meshing/Meshmerizer.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/Physics/Meshing') diff --git a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs index 1257804..d770ad1 100644 --- a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs +++ b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs @@ -287,7 +287,7 @@ namespace OpenSim.Region.Physics.Meshing long start = 0; using (MemoryStream data = new MemoryStream(primShape.SculptData)) { - meshOsd = (OSDMap)OSDParser.DeserializeLLSDBinary(data, true); + meshOsd = (OSDMap)OSDParser.DeserializeLLSDBinary(data); start = data.Position; } @@ -324,7 +324,7 @@ namespace OpenSim.Region.Physics.Meshing byte[] decompressedBuf = outMs.GetBuffer(); - decodedMeshOsd = OSDParser.DeserializeLLSDBinary(decompressedBuf, true); + decodedMeshOsd = OSDParser.DeserializeLLSDBinary(decompressedBuf); } } } -- cgit v1.1