aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs13
1 files changed, 11 insertions, 2 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 837779d..f9b90c5 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -96,6 +96,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
96 protected float m_ScriptDelayFactor = 1.0f; 96 protected float m_ScriptDelayFactor = 1.0f;
97 protected float m_ScriptDistanceFactor = 1.0f; 97 protected float m_ScriptDistanceFactor = 1.0f;
98 protected float m_MinTimerInterval = 0.5f; 98 protected float m_MinTimerInterval = 0.5f;
99 protected float m_recoilScaleFactor = 0.0f;
99 100
100 protected DateTime m_timer = DateTime.Now; 101 protected DateTime m_timer = DateTime.Now;
101 protected bool m_waitingForScriptAnswer = false; 102 protected bool m_waitingForScriptAnswer = false;
@@ -146,6 +147,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
146 // there's an smtp config, so load in the snooze time. 147 // there's an smtp config, so load in the snooze time.
147 EMAIL_PAUSE_TIME = SMTPConfig.GetInt("email_pause_time", EMAIL_PAUSE_TIME); 148 EMAIL_PAUSE_TIME = SMTPConfig.GetInt("email_pause_time", EMAIL_PAUSE_TIME);
148 } 149 }
150 // Rezzing an object with a velocity can create recoil. This feature seems to have been
151 // removed from recent versions of SL. The code computes recoil (vel*mass) and scales
152 // it by this factor. May be zero to turn off recoil all together.
153 m_recoilScaleFactor = m_ScriptEngine.Config.GetFloat("RecoilScaleFactor", m_recoilScaleFactor);
149 } 154 }
150 155
151 public override Object InitializeLifetimeService() 156 public override Object InitializeLifetimeService()
@@ -2829,10 +2834,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2829 2834
2830 PhysicsActor pa = new_group.RootPart.PhysActor; 2835 PhysicsActor pa = new_group.RootPart.PhysActor;
2831 2836
2837 //Recoil.
2832 if (pa != null && pa.IsPhysical && (Vector3)vel != Vector3.Zero) 2838 if (pa != null && pa.IsPhysical && (Vector3)vel != Vector3.Zero)
2833 { 2839 {
2834 //Recoil. 2840 Vector3 recoil = -vel * groupmass * m_recoilScaleFactor;
2835 llApplyImpulse(vel * groupmass, 0); 2841 if (recoil != Vector3.Zero)
2842 {
2843 llApplyImpulse(recoil, 0);
2844 }
2836 } 2845 }
2837 // Variable script delay? (see (http://wiki.secondlife.com/wiki/LSL_Delay) 2846 // Variable script delay? (see (http://wiki.secondlife.com/wiki/LSL_Delay)
2838 }); 2847 });