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') 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') 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') 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 +- OpenSim/Region/Physics/OdePlugin/ODECharacter.cs | 15 +++++++++++++-- OpenSim/Region/Physics/OdePlugin/OdePlugin.cs | 1 + 3 files changed, 15 insertions(+), 3 deletions(-) (limited to 'OpenSim') 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; } diff --git a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs index a00ba11..7a86b6e 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs +++ b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs @@ -98,6 +98,7 @@ namespace OpenSim.Region.Physics.OdePlugin private bool m_alwaysRun = false; private bool m_hackSentFall = false; private bool m_hackSentFly = false; + private int m_requestedUpdateFrequency = 0; private PhysicsVector m_taintPosition = new PhysicsVector(0, 0, 0); public uint m_localID = 0; public bool m_returnCollisions = false; @@ -1184,26 +1185,31 @@ namespace OpenSim.Region.Physics.OdePlugin public override void SubscribeEvents(int ms) { + m_requestedUpdateFrequency = ms; m_eventsubscription = ms; _parent_scene.addCollisionEventReporting(this); } public override void UnSubscribeEvents() { _parent_scene.remCollisionEventReporting(this); + m_requestedUpdateFrequency = 0; m_eventsubscription = 0; } public void AddCollisionEvent(uint CollidedWith, float depth) { if (m_eventsubscription > 0) - CollisionEventsThisFrame.addCollider(CollidedWith,depth); + { + CollisionEventsThisFrame.addCollider(CollidedWith, depth); + } } public void SendCollisions() { - if (m_eventsubscription > 0) + if (m_eventsubscription > m_requestedUpdateFrequency) { base.SendCollisionUpdate(CollisionEventsThisFrame); CollisionEventsThisFrame = new CollisionEventUpdate(); + m_eventsubscription = 0; } } public override bool SubscribedEvents() @@ -1309,5 +1315,10 @@ namespace OpenSim.Region.Physics.OdePlugin } } + + internal void AddCollisionFrameTime(int p) + { + m_eventsubscription += p; + } } } diff --git a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs index f5ab1de..083b7db 100644 --- a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs +++ b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs @@ -2928,6 +2928,7 @@ namespace OpenSim.Region.Physics.OdePlugin { case ActorTypes.Agent: OdeCharacter cobj = (OdeCharacter)obj; + cobj.AddCollisionFrameTime(100); cobj.SendCollisions(); break; case ActorTypes.Prim: -- 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 ++++-- OpenSim/Region/Physics/OdePlugin/ODECharacter.cs | 3 +++ 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'OpenSim') 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; diff --git a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs index 7a86b6e..bd81d50 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs +++ b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs @@ -1318,6 +1318,9 @@ namespace OpenSim.Region.Physics.OdePlugin internal void AddCollisionFrameTime(int p) { + // protect it from overflow crashing + if (m_eventsubscription + p >= int.MaxValue) + m_eventsubscription = 0; m_eventsubscription += p; } } -- cgit v1.1 From ef03b2d936fe623029bc414f00e001f17aaa85bc Mon Sep 17 00:00:00 2001 From: Melanie Date: Sat, 10 Oct 2009 10:18:16 +0100 Subject: Fix selling objects --- OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs index 901144a..fe9de1b 100644 --- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs +++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs @@ -556,6 +556,8 @@ namespace OpenSim.Region.CoreModules.World.Permissions // Customize the EveryoneMask uint objectEveryoneMask = ApplyObjectModifyMasks(task.EveryoneMask, objflags); + if (objectOwner != UUID.Zero) + objectEveryoneMask |= (uint)PrimFlags.ObjectAnyOwner; if (m_bypassPermissions) return objectOwnerMask; @@ -578,12 +580,9 @@ namespace OpenSim.Region.CoreModules.World.Permissions { // Admin objects should not be editable by the above if (!IsAdministrator(objectOwner)) - return objectOwnerMask; + return objectOwnerMask; } - if ((objectOwnerMask & (uint)PermissionMask.Transfer) != 0 && task.ObjectSaleType != 0) - objectEveryoneMask |= (uint)PrimFlags.ObjectTransfer; - // Group permissions if ((task.GroupID != UUID.Zero) && IsGroupMember(task.GroupID, user, 0)) return objectGroupMask | objectEveryoneMask; -- cgit v1.1