From 9b6e747d789bfc1ba0a193f7b5f8a02f19bf6654 Mon Sep 17 00:00:00 2001 From: Teravus Ovares Date: Mon, 12 Nov 2007 16:22:23 +0000 Subject: * Sets ZeroMesher as default. (If you want to cut and hollow, you'll need to uncomment the Meshmerizer in OpenSim.ini) * Fixes a geometry issue in ODE when using ZeroMesher --- OpenSim/Region/Physics/OdePlugin/OdePlugin.cs | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) (limited to 'OpenSim/Region/Physics/OdePlugin') diff --git a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs index 646ccb5..2ba8827 100644 --- a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs +++ b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs @@ -308,7 +308,11 @@ namespace OpenSim.Region.Physics.OdePlugin p = (OdePrim) prim; p.disableBody(); } - d.GeomDestroy(((OdePrim)prim).prim_geom); + if (((OdePrim)prim).prim_geom != null) + { + if (((OdePrim)prim).prim_geom != (IntPtr) 0) + d.GeomDestroy(((OdePrim)prim).prim_geom); + } _prims.Remove((OdePrim)prim); } @@ -1181,7 +1185,13 @@ namespace OpenSim.Region.Physics.OdePlugin IMesh mesh = _parent_scene.mesher.CreateMesh(oldname, _pbs, _size); // createmesh returns null when it's a shape that isn't a cube. if (mesh != null) - setMesh(_parent_scene, mesh); + { + setMesh(_parent_scene, mesh); + } + else + { + prim_geom = d.CreateBox(_parent_scene.space, _size.X, _size.Y, _size.Z); + } } else { prim_geom = d.CreateBox(_parent_scene.space, _size.X, _size.Y, _size.Z); @@ -1228,7 +1238,14 @@ namespace OpenSim.Region.Physics.OdePlugin if (this._parent_scene.needsMeshing(_pbs)) { IMesh mesh = _parent_scene.mesher.CreateMesh(oldname, _pbs, _size); - setMesh(_parent_scene, mesh); + if (mesh != null) + { + setMesh(_parent_scene, mesh); + } + else + { + prim_geom = d.CreateBox(_parent_scene.space, _size.X, _size.Y, _size.Z); + } } else { prim_geom = d.CreateBox(_parent_scene.space, _size.X, _size.Y, _size.Z); } -- cgit v1.1