From ac2f98b846eba85ab3d9acb5bd0f355a404de86c Mon Sep 17 00:00:00 2001 From: Teravus Ovares (Dan Olivares) Date: Fri, 16 Oct 2009 03:32:30 -0400 Subject: * A hacky attempt at resolving mantis #4260. I think ODE was unable to allocate memory, and therefore the unmanaged wrapper call fails or worse.. there's some unmanaged resource accounting in the ODEPlugin for ODECharacter that isn't being done properly now. * The broken avatar may not be able to move, but it won't stop simulate from pressing on now. And, the simulator will try to destroy the avatar's physics proxy and recreate it again... but if this is what I think it is, it may not help. --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 646a483..96fa467 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -3410,11 +3410,20 @@ namespace OpenSim.Region.Framework.Scenes scene.AddPhysicsActorTaint(m_physicsActor); //m_physicsActor.OnRequestTerseUpdate += SendTerseUpdateToAllClients; m_physicsActor.OnCollisionUpdate += PhysicsCollisionUpdate; + m_physicsActor.OnOutOfBounds += OutOfBoundsCall; // Called for PhysicsActors when there's something wrong m_physicsActor.SubscribeEvents(500); m_physicsActor.LocalID = LocalId; } + private void OutOfBoundsCall(PhysicsVector pos) + { + bool flying = m_physicsActor.Flying; + RemoveFromPhysicalScene(); + + AddToPhysicalScene(flying); + } + // Event called by the physics plugin to tell the avatar about a collision. private void PhysicsCollisionUpdate(EventArgs e) { -- cgit v1.1 From 67afa9e633b6b5c9c8be8f50eeecc5177c05119b Mon Sep 17 00:00:00 2001 From: Teravus Ovares (Dan Olivares) Date: Fri, 16 Oct 2009 03:52:57 -0400 Subject: * Make sure to unregister the OutOfBounds Physics event in RemoveFromPhysicalScene or we'll be leaking --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 1 + 1 file changed, 1 insertion(+) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 96fa467..b468dde 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -908,6 +908,7 @@ namespace OpenSim.Region.Framework.Scenes if (PhysicsActor != null) { m_physicsActor.OnRequestTerseUpdate -= SendTerseUpdateToAllClients; + m_physicsActor.OnOutOfBounds -= OutOfBoundsCall; m_scene.PhysicsScene.RemoveAvatar(PhysicsActor); m_physicsActor.UnSubscribeEvents(); m_physicsActor.OnCollisionUpdate -= PhysicsCollisionUpdate; -- cgit v1.1