From 6f220a867981db8e3357484feff1fe1977170561 Mon Sep 17 00:00:00 2001 From: Dan Lake Date: Fri, 5 Oct 2012 17:30:27 -0700 Subject: Trigger ObjectAddedToScene when loading objects from oarfile. Already triggers when creating, duplicating or loading from database, incoming attachments, etc --- OpenSim/Region/Framework/Scenes/Scene.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index e6b8c16..671feda 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -2139,7 +2139,14 @@ namespace OpenSim.Region.Framework.Scenes public bool AddRestoredSceneObject( SceneObjectGroup sceneObject, bool attachToBackup, bool alreadyPersisted, bool sendClientUpdates) { - return m_sceneGraph.AddRestoredSceneObject(sceneObject, attachToBackup, alreadyPersisted, sendClientUpdates); + if (m_sceneGraph.AddRestoredSceneObject(sceneObject, attachToBackup, alreadyPersisted, sendClientUpdates)) + { + EventManager.TriggerObjectAddedToScene(sceneObject); + return true; + } + + return false; + } /// -- cgit v1.1 From 91ca3117cb35444e6b0e4300468959ed43c048c3 Mon Sep 17 00:00:00 2001 From: Dan Lake Date: Fri, 5 Oct 2012 17:32:07 -0700 Subject: Add bool to TriggerSceneObjectPartUpdated where full = true indicates a full update. There should be a better way to indicate which properties have changed that is non LLUDP-centric --- OpenSim/Region/Framework/Scenes/EventManager.cs | 6 +++--- OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs index e25fa94..a8ff218 100644 --- a/OpenSim/Region/Framework/Scenes/EventManager.cs +++ b/OpenSim/Region/Framework/Scenes/EventManager.cs @@ -913,7 +913,7 @@ namespace OpenSim.Region.Framework.Scenes public event SceneObjectPartCopyDelegate OnSceneObjectPartCopy; public delegate void SceneObjectPartCopyDelegate(SceneObjectPart copy, SceneObjectPart original, bool userExposed); - public delegate void SceneObjectPartUpdated(SceneObjectPart sop); + public delegate void SceneObjectPartUpdated(SceneObjectPart sop, bool full); public event SceneObjectPartUpdated OnSceneObjectPartUpdated; public delegate void ScenePresenceUpdated(ScenePresence sp); @@ -2837,7 +2837,7 @@ namespace OpenSim.Region.Framework.Scenes } } - public void TriggerSceneObjectPartUpdated(SceneObjectPart sop) + public void TriggerSceneObjectPartUpdated(SceneObjectPart sop, bool full) { SceneObjectPartUpdated handler = OnSceneObjectPartUpdated; if (handler != null) @@ -2846,7 +2846,7 @@ namespace OpenSim.Region.Framework.Scenes { try { - d(sop); + d(sop, full); } catch (Exception e) { diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 3f10b34..199526e 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -2465,7 +2465,7 @@ namespace OpenSim.Region.Framework.Scenes // UUID, Name, TimeStampFull); if (ParentGroup.Scene != null) - ParentGroup.Scene.EventManager.TriggerSceneObjectPartUpdated(this); + ParentGroup.Scene.EventManager.TriggerSceneObjectPartUpdated(this, true); } /// @@ -2499,7 +2499,7 @@ namespace OpenSim.Region.Framework.Scenes } if (ParentGroup.Scene != null) - ParentGroup.Scene.EventManager.TriggerSceneObjectPartUpdated(this); + ParentGroup.Scene.EventManager.TriggerSceneObjectPartUpdated(this, false); } public void ScriptSetPhysicsStatus(bool UsePhysics) -- cgit v1.1 From 73c9abf5f2e2017bf924d6183502e337d28a7232 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 9 Oct 2012 01:35:27 +0100 Subject: Move OpenSim.Data.RegionFlags -> OpenSim.Framework.RegionFlags to make it easier for other code to use (e.g. LSL_Api) without having to reference OpenSim.Data just for this. --- OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | 1 + .../Framework/EntityTransfer/HGEntityTransferModule.cs | 8 ++++---- OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs | 1 + OpenSim/Region/CoreModules/World/Land/LandObject.cs | 1 + 4 files changed, 7 insertions(+), 4 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index 0869bd5..62f51d9 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs @@ -47,6 +47,7 @@ using OpenSim.Region.Framework.Scenes; using OpenSim.Services.Interfaces; using Timer = System.Timers.Timer; using AssetLandmark = OpenSim.Framework.AssetLandmark; +using RegionFlags = OpenMetaverse.RegionFlags; using Nini.Config; using System.IO; diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs index aa1e127..679be18 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs @@ -212,7 +212,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer int flags = Scene.GridService.GetRegionFlags(Scene.RegionInfo.ScopeID, region.RegionID); m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: region {0} flags: {1}", region.RegionID, flags); - if ((flags & (int)OpenSim.Data.RegionFlags.Hyperlink) != 0) + if ((flags & (int)OpenSim.Framework.RegionFlags.Hyperlink) != 0) { m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Destination region {0} is hyperlink", region.RegionID); GridRegion real_destination = m_GatekeeperConnector.GetHyperlinkRegion(region, region.RegionID); @@ -232,7 +232,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer return true; int flags = Scene.GridService.GetRegionFlags(Scene.RegionInfo.ScopeID, reg.RegionID); - if (flags == -1 /* no region in DB */ || (flags & (int)OpenSim.Data.RegionFlags.Hyperlink) != 0) + if (flags == -1 /* no region in DB */ || (flags & (int)OpenSim.Framework.RegionFlags.Hyperlink) != 0) return true; return false; @@ -256,7 +256,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer reason = string.Empty; logout = false; int flags = Scene.GridService.GetRegionFlags(Scene.RegionInfo.ScopeID, reg.RegionID); - if (flags == -1 /* no region in DB */ || (flags & (int)OpenSim.Data.RegionFlags.Hyperlink) != 0) + if (flags == -1 /* no region in DB */ || (flags & (int)OpenSim.Framework.RegionFlags.Hyperlink) != 0) { // this user is going to another grid // check if HyperGrid teleport is allowed, based on user level @@ -298,7 +298,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer // The rest is only needed for controlling appearance int flags = Scene.GridService.GetRegionFlags(Scene.RegionInfo.ScopeID, reg.RegionID); - if (flags == -1 /* no region in DB */ || (flags & (int)OpenSim.Data.RegionFlags.Hyperlink) != 0) + if (flags == -1 /* no region in DB */ || (flags & (int)OpenSim.Framework.RegionFlags.Hyperlink) != 0) { // this user is going to another grid if (Scene.UserManagementModule.IsLocalGridUser(sp.UUID)) diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs index 58bbd24..0e6d663 100644 --- a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs @@ -39,6 +39,7 @@ using OpenMetaverse; using OpenSim.Framework; using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; +using RegionFlags = OpenMetaverse.RegionFlags; namespace OpenSim.Region.CoreModules.World.Estate { diff --git a/OpenSim/Region/CoreModules/World/Land/LandObject.cs b/OpenSim/Region/CoreModules/World/Land/LandObject.cs index 0536f6e..8829f27 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandObject.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandObject.cs @@ -33,6 +33,7 @@ using OpenMetaverse; using OpenSim.Framework; using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; +using RegionFlags = OpenMetaverse.RegionFlags; namespace OpenSim.Region.CoreModules.World.Land { -- cgit v1.1 From 764270a0d81ef3aeba9ceb2eb50eab74a4707a95 Mon Sep 17 00:00:00 2001 From: teravus Date: Tue, 9 Oct 2012 09:26:11 -0400 Subject: Add config option to plant avatar where they are reducing avatar avatar 'pushability' av_planted see OpenSimDefaults.ini. Use when you have unruly visitors that rudely push each other around. Still allows a small amount of movement based on the avatar movement PID controller settings. You can increase the spring tension in the PID controller and really prevent any movement if you would like. --- OpenSim/Region/Physics/OdePlugin/ODECharacter.cs | 4 ++-- OpenSim/Region/Physics/OdePlugin/OdeScene.cs | 8 +++++++- 2 files changed, 9 insertions(+), 3 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs index f3b0630..c736557 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs +++ b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs @@ -100,7 +100,7 @@ namespace OpenSim.Region.Physics.OdePlugin private bool m_hackSentFly = false; private int m_requestedUpdateFrequency = 0; private Vector3 m_taintPosition; - + internal bool m_avatarplanted = false; /// /// Hold set forces so we can process them outside physics calculations. This prevents race conditions if we set force /// while calculatios are going on @@ -413,7 +413,7 @@ namespace OpenSim.Region.Physics.OdePlugin set { m_iscollidingObj = value; - if (value) + if (value && !m_avatarplanted) m_pidControllerActive = false; else m_pidControllerActive = true; diff --git a/OpenSim/Region/Physics/OdePlugin/OdeScene.cs b/OpenSim/Region/Physics/OdePlugin/OdeScene.cs index 7a50c4c..8421cdf 100644 --- a/OpenSim/Region/Physics/OdePlugin/OdeScene.cs +++ b/OpenSim/Region/Physics/OdePlugin/OdeScene.cs @@ -501,6 +501,8 @@ namespace OpenSim.Region.Physics.OdePlugin public int physics_logging_interval = 0; public bool physics_logging_append_existing_logfile = false; + private bool avplanted = false; + public d.Vector3 xyz = new d.Vector3(128.1640f, 128.3079f, 25.7600f); public d.Vector3 hpr = new d.Vector3(125.5000f, -17.0000f, 0.0000f); @@ -644,6 +646,8 @@ namespace OpenSim.Region.Physics.OdePlugin avMovementDivisorWalk = physicsconfig.GetFloat("av_movement_divisor_walk", 1.3f); avMovementDivisorRun = physicsconfig.GetFloat("av_movement_divisor_run", 0.8f); avCapRadius = physicsconfig.GetFloat("av_capsule_radius", 0.37f); + avplanted = physicsconfig.GetBoolean("av_planted", false); + IsAvCapsuleTilted = physicsconfig.GetBoolean("av_capsule_tilted", false); contactsPerCollision = physicsconfig.GetInt("contacts_per_collision", 80); @@ -1972,7 +1976,8 @@ namespace OpenSim.Region.Physics.OdePlugin newAv.Flying = isFlying; newAv.MinimumGroundFlightOffset = minimumGroundFlightOffset; - + newAv.m_avatarplanted = avplanted; + return newAv; } @@ -1987,6 +1992,7 @@ namespace OpenSim.Region.Physics.OdePlugin internal void AddCharacter(OdeCharacter chr) { + chr.m_avatarplanted = avplanted; if (!_characters.Contains(chr)) { _characters.Add(chr); -- cgit v1.1 From 7e90ea355120c717d1639d817b2b38326a4d5528 Mon Sep 17 00:00:00 2001 From: teravus Date: Tue, 9 Oct 2012 10:41:16 -0400 Subject: av_av_collisions_off = false OdePhysics Settings in OpenSimDefaults.ini - No Avatar Avatar Collisions. This causes avatar to be able to walk through each other as if they're ghosts but still interact with the environment. --- OpenSim/Region/Physics/OdePlugin/OdeScene.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Physics/OdePlugin/OdeScene.cs b/OpenSim/Region/Physics/OdePlugin/OdeScene.cs index 8421cdf..cbe21e2 100644 --- a/OpenSim/Region/Physics/OdePlugin/OdeScene.cs +++ b/OpenSim/Region/Physics/OdePlugin/OdeScene.cs @@ -502,7 +502,7 @@ namespace OpenSim.Region.Physics.OdePlugin public bool physics_logging_append_existing_logfile = false; private bool avplanted = false; - + private bool av_av_collisions_off = false; public d.Vector3 xyz = new d.Vector3(128.1640f, 128.3079f, 25.7600f); public d.Vector3 hpr = new d.Vector3(125.5000f, -17.0000f, 0.0000f); @@ -647,7 +647,8 @@ namespace OpenSim.Region.Physics.OdePlugin avMovementDivisorRun = physicsconfig.GetFloat("av_movement_divisor_run", 0.8f); avCapRadius = physicsconfig.GetFloat("av_capsule_radius", 0.37f); avplanted = physicsconfig.GetBoolean("av_planted", false); - + av_av_collisions_off = physicsconfig.GetBoolean("av_av_collisions_off", false); + IsAvCapsuleTilted = physicsconfig.GetBoolean("av_capsule_tilted", false); contactsPerCollision = physicsconfig.GetInt("contacts_per_collision", 80); @@ -667,6 +668,8 @@ namespace OpenSim.Region.Physics.OdePlugin meshSculptLOD = physicsconfig.GetFloat("mesh_lod", 32f); MeshSculptphysicalLOD = physicsconfig.GetFloat("mesh_physical_lod", 16f); m_filterCollisions = physicsconfig.GetBoolean("filter_collisions", false); + + if (Environment.OSVersion.Platform == PlatformID.Unix) { @@ -1313,6 +1316,10 @@ namespace OpenSim.Region.Physics.OdePlugin if ((p1 is OdePrim) && (((OdePrim)p1).m_isVolumeDetect)) skipThisContact = true; // No collision on volume detect prims + if (av_av_collisions_off) + if ((p1 is OdeCharacter) && (p2 is OdeCharacter)) + skipThisContact = true; + if (!skipThisContact && (p2 is OdePrim) && (((OdePrim)p2).m_isVolumeDetect)) skipThisContact = true; // No collision on volume detect prims -- cgit v1.1