From 6ad0f3250b31c392560af70330269ab7db9664a6 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Fri, 19 Aug 2016 21:28:40 +0100 Subject: fix ubOde prims unlink that got broken fixing sleeping bodies collisions, core removes and adds a prim with same LocalID not giving time for physics to actuly delete, so when it did it LocalID was lost --- OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs') diff --git a/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs b/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs index 6c5b405..623e6be 100644 --- a/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs +++ b/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs @@ -1328,8 +1328,6 @@ namespace OpenSim.Region.PhysicsModule.ubOde { newPrim = new OdePrim(name, this, position, size, rotation, pbs, isphysical, isPhantom, shapeType, localID); - lock (_prims) - _prims[newPrim.LocalID] = newPrim; } return newPrim; } @@ -1350,7 +1348,6 @@ namespace OpenSim.Region.PhysicsModule.ubOde public override PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position, Vector3 size, Quaternion rotation, bool isPhysical, bool isPhantom, byte shapeType, uint localid) { - return AddPrim(primName, position, size, rotation, pbs, isPhysical,isPhantom, shapeType, localid); } @@ -1396,6 +1393,12 @@ namespace OpenSim.Region.PhysicsModule.ubOde } + public void addToPrims(OdePrim prim) + { + lock (_prims) + _prims[prim.LocalID] = prim; + } + public OdePrim getPrim(uint id) { lock (_prims) @@ -1413,6 +1416,16 @@ namespace OpenSim.Region.PhysicsModule.ubOde return _prims.ContainsKey(prm.LocalID); } + public void changePrimID(OdePrim prim,uint oldID) + { + lock (_prims) + { + if(_prims.ContainsKey(oldID)) + _prims.Remove(oldID); + _prims[prim.LocalID] = prim; + } + } + public bool haveActor(PhysicsActor actor) { if (actor is OdePrim) -- cgit v1.1