aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/Meshing/Meshmerizer.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Physics/Meshing/Meshmerizer.cs')
-rw-r--r--OpenSim/Region/Physics/Meshing/Meshmerizer.cs21
1 files changed, 17 insertions, 4 deletions
diff --git a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs
index 99b2d84..a5fe45b 100644
--- a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs
+++ b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs
@@ -291,7 +291,14 @@ namespace OpenSim.Region.Physics.Meshing
291 { 291 {
292 try 292 try
293 { 293 {
294 meshOsd = (OSDMap)OSDParser.DeserializeLLSDBinary(data); 294 OSD osd = OSDParser.DeserializeLLSDBinary(data);
295 if (osd is OSDMap)
296 meshOsd = (OSDMap)osd;
297 else
298 {
299 m_log.Warn("[Mesh}: unable to cast mesh asset to OSDMap");
300 return null;
301 }
295 } 302 }
296 catch (Exception e) 303 catch (Exception e)
297 { 304 {
@@ -302,11 +309,17 @@ namespace OpenSim.Region.Physics.Meshing
302 309
303 if (meshOsd is OSDMap) 310 if (meshOsd is OSDMap)
304 { 311 {
312 OSDMap physicsParms = null;
305 OSDMap map = (OSDMap)meshOsd; 313 OSDMap map = (OSDMap)meshOsd;
306 OSDMap physicsParms = (OSDMap)map["physics_shape"]; // old asset format 314 if (map.ContainsKey("physics_shape"))
307 315 physicsParms = (OSDMap)map["physics_shape"]; // old asset format
308 if (physicsParms.Count == 0) 316 else if (map.ContainsKey("physics_mesh"))
309 physicsParms = (OSDMap)map["physics_mesh"]; // new asset format 317 physicsParms = (OSDMap)map["physics_mesh"]; // new asset format
318 if (physicsParms == null)
319 {
320 m_log.Warn("[Mesh]: no recognized physics mesh found in mesh asset");
321 return null;
322 }
310 323
311 int physOffset = physicsParms["offset"].AsInteger() + (int)start; 324 int physOffset = physicsParms["offset"].AsInteger() + (int)start;
312 int physSize = physicsParms["size"].AsInteger(); 325 int physSize = physicsParms["size"].AsInteger();