From 919118f0ef67d188753ac551414951ed653e814b Mon Sep 17 00:00:00 2001 From: Teravus Ovares Date: Tue, 6 Nov 2007 17:19:10 +0000 Subject: * fix for Bug 563 * fix for ODE geoms not getting disposed of properly when resizing. --- OpenSim/Region/Physics/OdePlugin/Meshing/Meshmerizer.cs | 6 +++++- OpenSim/Region/Physics/OdePlugin/OdePlugin.cs | 5 ++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/OpenSim/Region/Physics/OdePlugin/Meshing/Meshmerizer.cs b/OpenSim/Region/Physics/OdePlugin/Meshing/Meshmerizer.cs index 2a304cb..37fbb8a 100644 --- a/OpenSim/Region/Physics/OdePlugin/Meshing/Meshmerizer.cs +++ b/OpenSim/Region/Physics/OdePlugin/Meshing/Meshmerizer.cs @@ -361,7 +361,11 @@ namespace OpenSim.Region.Physics.OdePlugin.Meshing CalcNormals(mesh); break; default: - mesh = null; + mesh = CreateBoxMesh(primName, primShape, size); + CalcNormals(mesh); + //Set default mesh to cube otherwise it'll return + // null and crash on the 'setMesh' method in the physics plugins. + //mesh = null; break; } diff --git a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs index 4bd36aa..8b8aac6 100644 --- a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs +++ b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs @@ -1086,9 +1086,12 @@ namespace OpenSim.Region.Physics.OdePlugin // Construction of new prim if (this._parent_scene.needsMeshing(_pbs)) { - + + // Don't need to re-enable body.. it's done in SetMesh Mesh mesh = Meshmerizer.CreateMesh(oldname, _pbs, _size); + // createmesh returns null when it's a shape that isn't a cube. + if (mesh != null) setMesh(_parent_scene, mesh); } else { prim_geom = d.CreateBox(_parent_scene.space, _size.X, _size.Y, _size.Z); -- cgit v1.1