From e3a711536b4c2dad76184747faa0118942368400 Mon Sep 17 00:00:00 2001 From: Teravus Ovares Date: Thu, 14 Feb 2008 01:57:19 +0000 Subject: * ODE - This fixes a few things and breaks a few more. --- OpenSim/Region/Physics/Meshing/Meshmerizer.cs | 2 +- OpenSim/Region/Physics/OdePlugin/ODEPrim.cs | 22 +++++++++++++++------- OpenSim/Region/Physics/OdePlugin/OdePlugin.cs | 21 +++------------------ 3 files changed, 19 insertions(+), 26 deletions(-) (limited to 'OpenSim/Region/Physics') diff --git a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs index a394ffb..9244402 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 bf54b02..12da6a7 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 50687ed..f934341 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); -- cgit v1.1