diff options
author | Robert Adams | 2015-03-29 14:25:12 -0700 |
---|---|---|
committer | Robert Adams | 2015-03-29 14:25:12 -0700 |
commit | 07dead7dcb8b0f2a27a50748e4a460d9669903fc (patch) | |
tree | b61c3d892e83d36fece40e7735c5d97e64b9020f /OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |
parent | varregion: add varregion and TerrainData use in LLClientView. (diff) | |
download | opensim-SC_OLD-07dead7dcb8b0f2a27a50748e4a460d9669903fc.zip opensim-SC_OLD-07dead7dcb8b0f2a27a50748e4a460d9669903fc.tar.gz opensim-SC_OLD-07dead7dcb8b0f2a27a50748e4a460d9669903fc.tar.bz2 opensim-SC_OLD-07dead7dcb8b0f2a27a50748e4a460d9669903fc.tar.xz |
varregion: any conversions of use of Constants.RegionSize converted into
Util.cs routines to convert region coords to and from world coords or handles.
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index a5d8292..7d5c750 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -2351,7 +2351,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2351 | // | 2351 | // |
2352 | // This workaround is to prevent silent failure of this function. | 2352 | // This workaround is to prevent silent failure of this function. |
2353 | // According to the specification on the SL Wiki, providing a position outside of the | 2353 | // According to the specification on the SL Wiki, providing a position outside of the |
2354 | if (pos.x < 0 || pos.x > Constants.RegionSize || pos.y < 0 || pos.y > Constants.RegionSize) | 2354 | if (pos.x < 0 || pos.x > World.RegionInfo.RegionSizeX || pos.y < 0 || pos.y > World.RegionInfo.RegionSizeY) |
2355 | { | 2355 | { |
2356 | return 0; | 2356 | return 0; |
2357 | } | 2357 | } |
@@ -2361,9 +2361,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2361 | m_host.ParentGroup.IsAttachment || // return FALSE if attachment | 2361 | m_host.ParentGroup.IsAttachment || // return FALSE if attachment |
2362 | ( | 2362 | ( |
2363 | pos.x < -10.0 || // return FALSE if more than 10 meters into a west-adjacent region. | 2363 | pos.x < -10.0 || // return FALSE if more than 10 meters into a west-adjacent region. |
2364 | pos.x > (Constants.RegionSize + 10) || // return FALSE if more than 10 meters into a east-adjacent region. | 2364 | pos.x > (World.RegionInfo.RegionSizeX + 10) || // return FALSE if more than 10 meters into a east-adjacent region. |
2365 | pos.y < -10.0 || // return FALSE if more than 10 meters into a south-adjacent region. | 2365 | pos.y < -10.0 || // return FALSE if more than 10 meters into a south-adjacent region. |
2366 | pos.y > (Constants.RegionSize + 10) || // return FALSE if more than 10 meters into a north-adjacent region. | 2366 | pos.y > (World.RegionInfo.RegionSizeY + 10) || // return FALSE if more than 10 meters into a north-adjacent region. |
2367 | pos.z > Constants.RegionHeight // return FALSE if altitude than 4096m | 2367 | pos.z > Constants.RegionHeight // return FALSE if altitude than 4096m |
2368 | ) | 2368 | ) |
2369 | ) | 2369 | ) |
@@ -4654,10 +4654,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
4654 | DataserverPlugin.RegisterRequest(m_host.LocalId, | 4654 | DataserverPlugin.RegisterRequest(m_host.LocalId, |
4655 | m_item.ItemID, item.AssetID.ToString()); | 4655 | m_item.ItemID, item.AssetID.ToString()); |
4656 | 4656 | ||
4657 | Vector3 region = new Vector3( | 4657 | Vector3 region = new Vector3(World.RegionInfo.WorldLocX, World.RegionInfo.WorldLocY, 0); |
4658 | World.RegionInfo.RegionLocX * Constants.RegionSize, | ||
4659 | World.RegionInfo.RegionLocY * Constants.RegionSize, | ||
4660 | 0); | ||
4661 | 4658 | ||
4662 | World.AssetService.Get(item.AssetID.ToString(), this, | 4659 | World.AssetService.Get(item.AssetID.ToString(), this, |
4663 | delegate(string i, object sender, AssetBase a) | 4660 | delegate(string i, object sender, AssetBase a) |
@@ -5948,7 +5945,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5948 | public LSL_Vector llGetRegionCorner() | 5945 | public LSL_Vector llGetRegionCorner() |
5949 | { | 5946 | { |
5950 | m_host.AddScriptLPS(1); | 5947 | m_host.AddScriptLPS(1); |
5951 | return new LSL_Vector(World.RegionInfo.RegionLocX * Constants.RegionSize, World.RegionInfo.RegionLocY * Constants.RegionSize, 0); | 5948 | return new LSL_Vector(World.RegionInfo.WorldLocX, World.RegionInfo.WorldLocY, 0); |
5952 | } | 5949 | } |
5953 | 5950 | ||
5954 | /// <summary> | 5951 | /// <summary> |
@@ -6103,7 +6100,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
6103 | LSL_Float mag; | 6100 | LSL_Float mag; |
6104 | if (dir.x > 0) | 6101 | if (dir.x > 0) |
6105 | { | 6102 | { |
6106 | mag = (Constants.RegionSize - pos.x) / dir.x; | 6103 | mag = (World.RegionInfo.RegionSizeX - pos.x) / dir.x; |
6107 | } | 6104 | } |
6108 | else | 6105 | else |
6109 | { | 6106 | { |
@@ -6114,7 +6111,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
6114 | 6111 | ||
6115 | edge.y = pos.y + (dir.y * mag); | 6112 | edge.y = pos.y + (dir.y * mag); |
6116 | 6113 | ||
6117 | if (edge.y > Constants.RegionSize || edge.y < 0) | 6114 | if (edge.y > World.RegionInfo.RegionSizeY || edge.y < 0) |
6118 | { | 6115 | { |
6119 | // Y goes out of bounds first | 6116 | // Y goes out of bounds first |
6120 | edge.y = dir.y / Math.Abs(dir.y); | 6117 | edge.y = dir.y / Math.Abs(dir.y); |