diff options
author | Melanie Thielker | 2008-08-27 17:12:55 +0000 |
---|---|---|
committer | Melanie Thielker | 2008-08-27 17:12:55 +0000 |
commit | 1ac6bb3107228e669c0e95dc41166ad369cf752e (patch) | |
tree | 5f46a7001a6147c8aeabece9e21a631f87a40dfb /OpenSim | |
parent | reverting to prior meshing methods until some physics timing issues can be re... (diff) | |
download | opensim-SC_OLD-1ac6bb3107228e669c0e95dc41166ad369cf752e.zip opensim-SC_OLD-1ac6bb3107228e669c0e95dc41166ad369cf752e.tar.gz opensim-SC_OLD-1ac6bb3107228e669c0e95dc41166ad369cf752e.tar.bz2 opensim-SC_OLD-1ac6bb3107228e669c0e95dc41166ad369cf752e.tar.xz |
Add ScriptDistanceLimitFactor to OpenSim.ini to allow modifcation of
LSL's arbitrary 10 m limit on object movement.
Also implements the 10 m maximum rezzing distance, subhect to the same
factor.
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs index 60ed5c1..74ba4fa 100644 --- a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs +++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs | |||
@@ -78,6 +78,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
78 | config.AddConfig("LL-Functions"); | 78 | config.AddConfig("LL-Functions"); |
79 | 79 | ||
80 | m_delayFactor = config.Configs["LL-Functions"].GetFloat("ScriptDelayFactor", 1.0f); | 80 | m_delayFactor = config.Configs["LL-Functions"].GetFloat("ScriptDelayFactor", 1.0f); |
81 | m_distanceFactor = config.Configs["LL-Functions"].GetFloat("ScriptDistanceLimitFactor", 1.0f); | ||
81 | 82 | ||
82 | } | 83 | } |
83 | 84 | ||
@@ -85,6 +86,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
85 | private string m_state = "default"; | 86 | private string m_state = "default"; |
86 | private bool m_waitingForScriptAnswer=false; | 87 | private bool m_waitingForScriptAnswer=false; |
87 | private float m_delayFactor = 1.0f; | 88 | private float m_delayFactor = 1.0f; |
89 | private float m_distanceFactor = 1.0f; | ||
88 | 90 | ||
89 | 91 | ||
90 | private void ScriptSleep(int delay) | 92 | private void ScriptSleep(int delay) |
@@ -1658,7 +1660,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
1658 | LSL_Types.Vector3 currentPos = llGetLocalPos(); | 1660 | LSL_Types.Vector3 currentPos = llGetLocalPos(); |
1659 | if (llVecDist(currentPos, targetPos) > 10) | 1661 | if (llVecDist(currentPos, targetPos) > 10) |
1660 | { | 1662 | { |
1661 | targetPos = currentPos + 10 * llVecNorm(targetPos - currentPos); | 1663 | targetPos = currentPos + m_distanceFactor * 10.0f * llVecNorm(targetPos - currentPos); |
1662 | } | 1664 | } |
1663 | 1665 | ||
1664 | if (part.ParentID != 0) | 1666 | if (part.ParentID != 0) |
@@ -2293,6 +2295,10 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
2293 | m_host.AddScriptLPS(1); | 2295 | m_host.AddScriptLPS(1); |
2294 | bool found = false; | 2296 | bool found = false; |
2295 | 2297 | ||
2298 | float dist = (float)llVecDist(llGetPos(), pos); | ||
2299 | if(dist > m_distanceFactor * 10.0f) | ||
2300 | return; | ||
2301 | |||
2296 | // Instead of using return;, I'm using continue; because in our TaskInventory implementation | 2302 | // Instead of using return;, I'm using continue; because in our TaskInventory implementation |
2297 | // it's possible to have two items with the same task inventory name. | 2303 | // it's possible to have two items with the same task inventory name. |
2298 | // this is an easter egg of sorts. | 2304 | // this is an easter egg of sorts. |