From 798bce592f7c467bbfdf2be8820d626520f378dc Mon Sep 17 00:00:00 2001 From: Teravus Ovares (Dan Olivares) Date: Sat, 10 Oct 2009 01:16:34 -0400 Subject: * Move the 'On Collision Update Movement Animation' routine to above the 'm_invulnerable' test. It doesn't fix anything but it should really be there anyway. --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 3996cdc..0352c64 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -3417,7 +3417,13 @@ namespace OpenSim.Region.Framework.Scenes // Event called by the physics plugin to tell the avatar about a collision. private void PhysicsCollisionUpdate(EventArgs e) { - if ((e == null) || m_invulnerable) + if (e == null) + return; + + if (Velocity.X > 0 || Velocity.Y > 0) + UpdateMovementAnimations(); + + if (m_invulnerable) return; CollisionEventUpdate collisionData = (CollisionEventUpdate)e; Dictionary coldata = collisionData.m_objCollisionList; @@ -3455,8 +3461,7 @@ namespace OpenSim.Region.Framework.Scenes m_scene.EventManager.TriggerAvatarKill(killerObj, this); } - if (Velocity.X > 0 || Velocity.Y > 0) - UpdateMovementAnimations(); + } public void setHealthWithUpdate(float health) -- cgit v1.1 From 5f94889044656211d05b62c7253b1aad19a23eab Mon Sep 17 00:00:00 2001 From: Teravus Ovares (Dan Olivares) Date: Sat, 10 Oct 2009 01:49:06 -0400 Subject: * Fix incorrect math on the Velocity check in PhysicsCollisionUpdate. This may reduce avatar flailing. --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 0352c64..af85424 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -3420,7 +3420,7 @@ namespace OpenSim.Region.Framework.Scenes if (e == null) return; - if (Velocity.X > 0 || Velocity.Y > 0) + if ((Math.Abs(Velocity.X) > 0.05f) || (Math.Abs(Velocity.Y) > 0.05f)) UpdateMovementAnimations(); if (m_invulnerable) -- cgit v1.1 From d7654c3bda9c6fea93ddc258b00e41eb568faa18 Mon Sep 17 00:00:00 2001 From: dahlia Date: Sat, 10 Oct 2009 00:26:43 -0700 Subject: Adjust velocity threshold for triggering flailing. Thanks to KittoFlora for researching this. --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index af85424..7ea9314 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -3420,7 +3420,7 @@ namespace OpenSim.Region.Framework.Scenes if (e == null) return; - if ((Math.Abs(Velocity.X) > 0.05f) || (Math.Abs(Velocity.Y) > 0.05f)) + if ((Math.Abs(Velocity.X) > 0.1e-9f) || (Math.Abs(Velocity.Y) > 0.1e-9f)) UpdateMovementAnimations(); if (m_invulnerable) -- cgit v1.1 From 4ffe936ba837eb47dc235317a54f5fa16af514ce Mon Sep 17 00:00:00 2001 From: Teravus Ovares (Dan Olivares) Date: Sat, 10 Oct 2009 03:53:53 -0400 Subject: * Make ODECharacter respect the scene's requested collision update time * Set the Scene collision update time to 500 ms --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index af85424..e9040e9 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -3409,7 +3409,7 @@ namespace OpenSim.Region.Framework.Scenes scene.AddPhysicsActorTaint(m_physicsActor); //m_physicsActor.OnRequestTerseUpdate += SendTerseUpdateToAllClients; m_physicsActor.OnCollisionUpdate += PhysicsCollisionUpdate; - m_physicsActor.SubscribeEvents(1000); + m_physicsActor.SubscribeEvents(500); m_physicsActor.LocalID = LocalId; } -- cgit v1.1 From 8271528b1fe49d99cf5b64d3644864ba4aa097c1 Mon Sep 17 00:00:00 2001 From: Teravus Ovares (Dan Olivares) Date: Sat, 10 Oct 2009 04:01:36 -0400 Subject: * comment out the velocity test, using updates every 500 ms as set in ScenePresence.AddToPhysicalScene. * This causes time to be counted in ODECharacter and, when a collision occurs, the physics scene will report the collisions only if the the difference of last time it reported the collisions from now was more then the set ms. * This is cool because the time accrues while collisions are not taking place and when they do take place again, you get an immediate update. --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index e20b8f2..15fb11f 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -3420,8 +3420,10 @@ namespace OpenSim.Region.Framework.Scenes if (e == null) return; - if ((Math.Abs(Velocity.X) > 0.1e-9f) || (Math.Abs(Velocity.Y) > 0.1e-9f)) - UpdateMovementAnimations(); + //if ((Math.Abs(Velocity.X) > 0.1e-9f) || (Math.Abs(Velocity.Y) > 0.1e-9f)) + // The Physics Scene will send updates every 500 ms grep: m_physicsActor.SubscribeEvents( + // as of this comment the interval is set in AddToPhysicalScene + UpdateMovementAnimations(); if (m_invulnerable) return; -- cgit v1.1