From 32904c0ce82093d56782caf0cd79f439048696e2 Mon Sep 17 00:00:00 2001 From: Melanie Date: Mon, 21 Dec 2009 22:05:43 +0000 Subject: When a script has been loaded, remove it's state entry, so recompiling doesn't pick up the old state again. --- OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs | 1 + 1 file changed, 1 insertion(+) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs index 47e4ad0..b98747a 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs @@ -333,6 +333,7 @@ namespace OpenSim.Region.Framework.Scenes break; } } + m_part.ParentGroup.m_savedScriptState.Remove(oldID); } } -- cgit v1.1 From e530180c1e8e9758df7cb9a72ad0715fd7c8a0e7 Mon Sep 17 00:00:00 2001 From: Melanie Date: Tue, 22 Dec 2009 00:26:12 +0000 Subject: Glue code for a couple of new LSL function implementations --- .../Region/Framework/Scenes/SceneObjectGroup.cs | 39 ++++++++++++++++++++++ OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 12 +++++++ 2 files changed, 51 insertions(+) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index cb87212..e9ed066 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -1734,6 +1734,45 @@ namespace OpenSim.Region.Framework.Scenes } } } + + public void rotLookAt(Quaternion target, float strength, float damping) + { + SceneObjectPart rootpart = m_rootPart; + if (rootpart != null) + { + if (IsAttachment) + { + /* + ScenePresence avatar = m_scene.GetScenePresence(rootpart.AttachedAvatar); + if (avatar != null) + { + Rotate the Av? + } */ + } + else + { + if (rootpart.PhysActor != null) + { + rootpart.PhysActor.APIDTarget = new Quaternion(target.X, target.Y, target.Z, target.W); + rootpart.PhysActor.APIDStrength = strength; + rootpart.PhysActor.APIDDamping = damping; + rootpart.PhysActor.APIDActive = true; + } + } + } + } + public void stopLookAt() + { + SceneObjectPart rootpart = m_rootPart; + if (rootpart != null) + { + if (rootpart.PhysActor != null) + { + rootpart.PhysActor.APIDActive = false; + } + } + + } /// /// Uses a PID to attempt to clamp the object on the Z axis at the given height over tau seconds. diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index b6916f2..c0243a5 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -2185,6 +2185,11 @@ namespace OpenSim.Region.Framework.Scenes ParentGroup.HasGroupChanged = true; ScheduleFullUpdate(); } + + public void RotLookAt(Quaternion target, float strength, float damping) + { + m_parentGroup.rotLookAt(target, strength, damping); + } /// /// Schedules this prim for a full update @@ -2668,7 +2673,14 @@ namespace OpenSim.Region.Framework.Scenes ParentGroup.HasGroupChanged = true; ScheduleFullUpdate(); } + + public void StopLookAt() + { + m_parentGroup.stopLookAt(); + m_parentGroup.ScheduleGroupForTerseUpdate(); + } + /// /// Set the text displayed for this part. /// -- cgit v1.1 From 69b551c51686bca58c478f517f6ccfa561ad9730 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 22 Dec 2009 03:22:33 +0100 Subject: Allow 100ms for scripts to run attach(NULL_KEY) on detach --- OpenSim/Region/Framework/Scenes/SceneGraph.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index f74fd5d..e875525 100644 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs @@ -542,6 +542,18 @@ namespace OpenSim.Region.Framework.Scenes if (group.GetFromItemID() == itemID) { m_parentScene.SendAttachEvent(group.LocalId, itemID, UUID.Zero); + bool hasScripts = false; + foreach (SceneObjectPart part in group.Children) + { + if (part..Inventory.ContainsScripts()) + { + hasScripts = true; + break; + } + } + + if (hasScripts) // Allow the object to execute the attach(NULL_KEY) event + System.Threading.Thread.Sleep(100); group.DetachToInventoryPrep(); m_log.Debug("[DETACH]: Saving attachpoint: " + ((uint)group.GetAttachmentPoint()).ToString()); -- cgit v1.1 From 46fea747265574bb056b8d1ffa189ec3725a7abc Mon Sep 17 00:00:00 2001 From: root Date: Tue, 22 Dec 2009 03:25:09 +0100 Subject: Jumped the gun... --- OpenSim/Region/Framework/Scenes/SceneGraph.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index e875525..fadeaf4 100644 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs @@ -545,7 +545,7 @@ namespace OpenSim.Region.Framework.Scenes bool hasScripts = false; foreach (SceneObjectPart part in group.Children) { - if (part..Inventory.ContainsScripts()) + if (part.Inventory.ContainsScripts()) { hasScripts = true; break; -- cgit v1.1 From 49fbe0ddb429b8625682255bf0cafa9ea93d274a Mon Sep 17 00:00:00 2001 From: root Date: Tue, 22 Dec 2009 03:26:47 +0100 Subject: Should not commit without compiling --- OpenSim/Region/Framework/Scenes/SceneGraph.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index fadeaf4..b0fb8b3 100644 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs @@ -543,7 +543,7 @@ namespace OpenSim.Region.Framework.Scenes { m_parentScene.SendAttachEvent(group.LocalId, itemID, UUID.Zero); bool hasScripts = false; - foreach (SceneObjectPart part in group.Children) + foreach (SceneObjectPart part in group.Children.Values) { if (part.Inventory.ContainsScripts()) { -- cgit v1.1