aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/Meshing/Meshmerizer.cs
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2011-06-30 22:41:21 +0100
committerJustin Clark-Casey (justincc)2011-06-30 22:41:21 +0100
commit2d2c29ef3e7bb20c882d39164fa2475ed637cf2a (patch)
treec35c9acd3ceb9ba0647eb6b8b41dfb9b58ea53c0 /OpenSim/Region/Physics/Meshing/Meshmerizer.cs
parentimprove and tidy up some config file comments (diff)
parentAllow physics proxy generation for meshes using new asset format. (diff)
downloadopensim-SC-2d2c29ef3e7bb20c882d39164fa2475ed637cf2a.zip
opensim-SC-2d2c29ef3e7bb20c882d39164fa2475ed637cf2a.tar.gz
opensim-SC-2d2c29ef3e7bb20c882d39164fa2475ed637cf2a.tar.bz2
opensim-SC-2d2c29ef3e7bb20c882d39164fa2475ed637cf2a.tar.xz
Merge branch 'master' of ssh://opensimulator.org/var/git/opensim
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();