diff --git a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs index a394ffb108..9244402329 100644 --- a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs +++ b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs @@ -520,7 +520,7 @@ namespace OpenSim.Region.Physics.Meshing // Calculated separately to avoid errors cutHull.AddVertex(legEnd); - m_log.DebugFormat("Starting cutting of the hollow shape from the prim {1}", 0, primName); + // m_log.DebugFormat("Starting cutting of the hollow shape from the prim {1}", 0, primName); SimpleHull cuttedHull = SimpleHull.SubtractHull(outerHull, cutHull); outerHull = cuttedHull; diff --git a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs index bf54b02e40..12da6a7e1a 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs +++ b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs @@ -92,7 +92,7 @@ namespace OpenSim.Region.Physics.OdePlugin private int debugcounter = 0; - public OdePrim(String primName, OdeScene parent_scene, IntPtr targetSpace, PhysicsVector pos, PhysicsVector size, + public OdePrim(String primName, OdeScene parent_scene, PhysicsVector pos, PhysicsVector size, Quaternion rotation, IMesh mesh, PrimitiveBaseShape pbs, bool pisPhysical, CollisionLocker dode) { ode = dode; @@ -126,7 +126,7 @@ namespace OpenSim.Region.Physics.OdePlugin _pbs = pbs; _parent_scene = parent_scene; - m_targetSpace = targetSpace; + m_targetSpace = (IntPtr)0; if (pos.Z < 0) m_isphysical = false; @@ -433,6 +433,14 @@ namespace OpenSim.Region.Physics.OdePlugin } public void changeadd(float timestep) { + int[] iprimspaceArrItem = _parent_scene.calculateSpaceArrayItemFromPos(_position); + IntPtr targetspace = _parent_scene.calculateSpaceForGeom(_position); + + if (targetspace == IntPtr.Zero) + targetspace = _parent_scene.createprimspace(iprimspaceArrItem[0], iprimspaceArrItem[1]); + + m_targetSpace = targetspace; + if (_mesh != null) { } @@ -630,11 +638,11 @@ namespace OpenSim.Region.Physics.OdePlugin public void changesize(float timestamp) { - if (!_parent_scene.geom_name_map.ContainsKey(prim_geom)) - { - m_taintsize = _size; - return; - } + //if (!_parent_scene.geom_name_map.ContainsKey(prim_geom)) + //{ + // m_taintsize = _size; + //return; + //} string oldname = _parent_scene.geom_name_map[prim_geom]; diff --git a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs index 50687ed7e0..f93434130d 100644 --- a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs +++ b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs @@ -1033,16 +1033,11 @@ namespace OpenSim.Region.Physics.OdePlugin rot.z = rotation.z; - int[] iprimspaceArrItem = calculateSpaceArrayItemFromPos(pos); - IntPtr targetspace = calculateSpaceForGeom(pos); - - if (targetspace == IntPtr.Zero) - targetspace = createprimspace(iprimspaceArrItem[0], iprimspaceArrItem[1]); - + OdePrim newPrim; lock (OdeLock) { - newPrim = new OdePrim(name, this, targetspace, pos, siz, rot, mesh, pbs, isphysical, ode); + newPrim = new OdePrim(name, this, pos, siz, rot, mesh, pbs, isphysical, ode); _prims.Add(newPrim); } @@ -1244,18 +1239,8 @@ namespace OpenSim.Region.Physics.OdePlugin collision_optimized(timeStep); - - + d.WorldQuickStep(world, ODE_STEPSIZE); - - try - { - d.WorldQuickStep(world, ODE_STEPSIZE); - } - catch (StackOverflowException) - { - d.WorldQuickStep(world, 0.001f); - } d.JointGroupEmpty(contactgroup); ode.dunlock(world);