mirror of
https://github.com/opensim/opensim.git
synced 2026-08-05 00:46:02 +08:00
Merge branch 'master' into careminster
Conflicts: OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
This commit is contained in:
@@ -100,6 +100,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
protected float m_ScriptDelayFactor = 1.0f;
|
||||
protected float m_ScriptDistanceFactor = 1.0f;
|
||||
protected float m_MinTimerInterval = 0.5f;
|
||||
protected float m_recoilScaleFactor = 0.0f;
|
||||
|
||||
protected DateTime m_timer = DateTime.Now;
|
||||
protected bool m_waitingForScriptAnswer = false;
|
||||
@@ -187,6 +188,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
// there's an smtp config, so load in the snooze time.
|
||||
EMAIL_PAUSE_TIME = SMTPConfig.GetInt("email_pause_time", EMAIL_PAUSE_TIME);
|
||||
}
|
||||
// Rezzing an object with a velocity can create recoil. This feature seems to have been
|
||||
// removed from recent versions of SL. The code computes recoil (vel*mass) and scales
|
||||
// it by this factor. May be zero to turn off recoil all together.
|
||||
m_recoilScaleFactor = m_ScriptEngine.Config.GetFloat("RecoilScaleFactor", m_recoilScaleFactor);
|
||||
}
|
||||
|
||||
public override Object InitializeLifetimeService()
|
||||
@@ -3108,11 +3113,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
|
||||
PhysicsActor pa = new_group.RootPart.PhysActor;
|
||||
|
||||
//Recoil.
|
||||
if (pa != null && pa.IsPhysical && (Vector3)vel != Vector3.Zero)
|
||||
{
|
||||
float groupmass = new_group.GetMass();
|
||||
vel *= -groupmass;
|
||||
llApplyImpulse(vel, 0);
|
||||
Vector3 recoil = -vel * groupmass * m_recoilScaleFactor;
|
||||
if (recoil != Vector3.Zero)
|
||||
{
|
||||
llApplyImpulse(recoil, 0);
|
||||
}
|
||||
}
|
||||
// Variable script delay? (see (http://wiki.secondlife.com/wiki/LSL_Delay)
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user