aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorRobert Adams2012-12-29 18:31:38 -0800
committerRobert Adams2012-12-31 19:57:20 -0800
commit4914d6c0ea02ac0060f2fd7e145119603ecd8e5b (patch)
treebdbf0ffed1c1bbdb1df0cdc179887580060ec40a
parentComment out test messages that go directly to the console. (diff)
downloadopensim-SC-4914d6c0ea02ac0060f2fd7e145119603ecd8e5b.zip
opensim-SC-4914d6c0ea02ac0060f2fd7e145119603ecd8e5b.tar.gz
opensim-SC-4914d6c0ea02ac0060f2fd7e145119603ecd8e5b.tar.bz2
opensim-SC-4914d6c0ea02ac0060f2fd7e145119603ecd8e5b.tar.xz
Resolve Mantis 6480 (http://opensimulator.org/mantis/view.php?id=6480)
by reversing the sign on the recoil computation and adding a [XEngine]RecoilScaleFactor parameter which defaults to zero. Testing in SL seems to show that there is not a recoil action there. Or, at least, it is very small. If someone knows how small, the default for the scale factor should be changed.
-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 });