aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework
diff options
context:
space:
mode:
authorMelanie2012-01-14 06:09:19 +0000
committerMelanie2012-01-14 06:09:19 +0000
commit43128c9016ea4482bdc38b1b099b67929e28a68b (patch)
treeeafe72f6235ac4d148d4778d67a131a5228ca2dd /OpenSim/Region/Framework
parentAllow SmtpClients and other SSL users to work with our cert handler installed (diff)
parentAllow SmtpClients and other SSL users to work with our cert handler installed (diff)
downloadopensim-SC-43128c9016ea4482bdc38b1b099b67929e28a68b.zip
opensim-SC-43128c9016ea4482bdc38b1b099b67929e28a68b.tar.gz
opensim-SC-43128c9016ea4482bdc38b1b099b67929e28a68b.tar.bz2
opensim-SC-43128c9016ea4482bdc38b1b099b67929e28a68b.tar.xz
Merge branch 'master' into careminster
Conflicts: OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs OpenSim/Region/Framework/Scenes/SceneObjectPart.cs OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
Diffstat (limited to 'OpenSim/Region/Framework')
-rw-r--r--OpenSim/Region/Framework/Interfaces/IRegionReadyModule.cs38
-rw-r--r--OpenSim/Region/Framework/Interfaces/IScriptModule.cs13
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs64
3 files changed, 81 insertions, 34 deletions
diff --git a/OpenSim/Region/Framework/Interfaces/IRegionReadyModule.cs b/OpenSim/Region/Framework/Interfaces/IRegionReadyModule.cs
new file mode 100644
index 0000000..aa4a757
--- /dev/null
+++ b/OpenSim/Region/Framework/Interfaces/IRegionReadyModule.cs
@@ -0,0 +1,38 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28
29using System;
30
31namespace OpenSim.Region.Framework.Interfaces
32{
33 public interface IRegionReadyModule
34 {
35 void OarLoadingAlert(string msg);
36 }
37}
38
diff --git a/OpenSim/Region/Framework/Interfaces/IScriptModule.cs b/OpenSim/Region/Framework/Interfaces/IScriptModule.cs
index 9d68eb4..2d6758b 100644
--- a/OpenSim/Region/Framework/Interfaces/IScriptModule.cs
+++ b/OpenSim/Region/Framework/Interfaces/IScriptModule.cs
@@ -31,8 +31,21 @@ using OpenMetaverse;
31 31
32namespace OpenSim.Region.Framework.Interfaces 32namespace OpenSim.Region.Framework.Interfaces
33{ 33{
34 public delegate void ScriptRemoved(UUID script);
35 public delegate void ObjectRemoved(UUID prim);
36
34 public interface IScriptModule: INonSharedRegionModule 37 public interface IScriptModule: INonSharedRegionModule
35 { 38 {
39 /// <summary>
40 /// Triggered when a script is removed from the script module.
41 /// </summary>
42 event ScriptRemoved OnScriptRemoved;
43
44 /// <summary>
45 /// Triggered when an object is removed via the script module.
46 /// </summary>
47 event ObjectRemoved OnObjectRemoved;
48
36 string ScriptEngineName { get; } 49 string ScriptEngineName { get; }
37 50
38 string GetXMLState(UUID itemID); 51 string GetXMLState(UUID itemID);
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index 193ef0d..c9a8832 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -226,11 +226,10 @@ namespace OpenSim.Region.Framework.Scenes
226 226
227 public Quaternion SpinOldOrientation = Quaternion.Identity; 227 public Quaternion SpinOldOrientation = Quaternion.Identity;
228 228
229 public Quaternion m_APIDTarget = Quaternion.Identity; 229 protected int m_APIDIterations = 0;
230 230 protected Quaternion m_APIDTarget = Quaternion.Identity;
231 public float m_APIDDamp = 0; 231 protected float m_APIDDamp = 0;
232 232 protected float m_APIDStrength = 0;
233 public float m_APIDStrength = 0;
234 233
235 /// <summary> 234 /// <summary>
236 /// This part's inventory 235 /// This part's inventory
@@ -578,22 +577,21 @@ namespace OpenSim.Region.Framework.Scenes
578 } 577 }
579 } 578 }
580 579
581 580 protected Quaternion APIDTarget
582 public Quaternion APIDTarget
583 { 581 {
584 get { return m_APIDTarget; } 582 get { return m_APIDTarget; }
585 set { m_APIDTarget = value; } 583 set { m_APIDTarget = value; }
586 } 584 }
587 585
588 586
589 public float APIDDamp 587 protected float APIDDamp
590 { 588 {
591 get { return m_APIDDamp; } 589 get { return m_APIDDamp; }
592 set { m_APIDDamp = value; } 590 set { m_APIDDamp = value; }
593 } 591 }
594 592
595 593
596 public float APIDStrength 594 protected float APIDStrength
597 { 595 {
598 get { return m_APIDStrength; } 596 get { return m_APIDStrength; }
599 set { m_APIDStrength = value; } 597 set { m_APIDStrength = value; }
@@ -2768,17 +2766,26 @@ namespace OpenSim.Region.Framework.Scenes
2768 APIDDamp = damping; 2766 APIDDamp = damping;
2769 APIDStrength = strength; 2767 APIDStrength = strength;
2770 APIDTarget = target; 2768 APIDTarget = target;
2769
2770 if (APIDStrength <= 0)
2771 {
2772 m_log.WarnFormat("[SceneObjectPart] Invalid rotation strength {0}",APIDStrength);
2773 return;
2774 }
2775
2776 m_APIDIterations = 1 + (int)(Math.PI * APIDStrength);
2771 } 2777 }
2778
2779 // Necessary to get the lookat deltas applied
2780 ParentGroup.QueueForUpdateCheck();
2772 } 2781 }
2773 2782
2774 public void startLookAt(Quaternion rot, float damp, float strength) 2783 public void StartLookAt(Quaternion target, float strength, float damping)
2775 { 2784 {
2776 APIDDamp = damp; 2785 RotLookAt(target,strength,damping);
2777 APIDStrength = strength;
2778 APIDTarget = rot;
2779 } 2786 }
2780 2787
2781 public void stopLookAt() 2788 public void StopLookAt()
2782 { 2789 {
2783 APIDTarget = Quaternion.Identity; 2790 APIDTarget = Quaternion.Identity;
2784 } 2791 }
@@ -3468,13 +3475,6 @@ namespace OpenSim.Region.Framework.Scenes
3468 } 3475 }
3469 } 3476 }
3470 3477
3471 public void StopLookAt()
3472 {
3473 ParentGroup.stopLookAt();
3474
3475 ParentGroup.ScheduleGroupForTerseUpdate();
3476 }
3477
3478 /// <summary> 3478 /// <summary>
3479 /// Set the text displayed for this part. 3479 /// Set the text displayed for this part.
3480 /// </summary> 3480 /// </summary>
@@ -4790,24 +4790,20 @@ namespace OpenSim.Region.Framework.Scenes
4790 { 4790 {
4791 if (APIDTarget != Quaternion.Identity) 4791 if (APIDTarget != Quaternion.Identity)
4792 { 4792 {
4793 if (Single.IsNaN(APIDTarget.W) == true) 4793 if (m_APIDIterations <= 1)
4794 { 4794 {
4795 UpdateRotation(APIDTarget);
4795 APIDTarget = Quaternion.Identity; 4796 APIDTarget = Quaternion.Identity;
4796 return; 4797 return;
4797 } 4798 }
4798 Quaternion rot = RotationOffset; 4799
4799 Quaternion dir = (rot - APIDTarget); 4800 Quaternion rot = Quaternion.Slerp(RotationOffset,APIDTarget,1.0f/(float)m_APIDIterations);
4800 float speed = ((APIDStrength / APIDDamp) * (float)(Math.PI / 180.0f));
4801 if (dir.Z > speed)
4802 {
4803 rot.Z -= speed;
4804 }
4805 if (dir.Z < -speed)
4806 {
4807 rot.Z += speed;
4808 }
4809 rot.Normalize();
4810 UpdateRotation(rot); 4801 UpdateRotation(rot);
4802
4803 m_APIDIterations--;
4804
4805 // This ensures that we'll check this object on the next iteration
4806 ParentGroup.QueueForUpdateCheck();
4811 } 4807 }
4812 } 4808 }
4813 catch (Exception ex) 4809 catch (Exception ex)