4096 is used in various places as the maximum height of a region, refactoring to be a constant

connector_plugin
SignpostMarv 2012-09-06 10:54:45 +01:00 committed by Justin Clark-Casey (justincc)
parent df3914c7cd
commit 874bde366a
3 changed files with 4 additions and 3 deletions

View File

@ -31,6 +31,7 @@ namespace OpenSim.Framework
public class Constants
{
public const uint RegionSize = 256;
public const uint RegionHeight = 4096;
public const byte TerrainPatchSize = 16;
public const string DefaultTexture = "89556747-24cb-43ed-920b-47caed15465f";

View File

@ -1948,7 +1948,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
pos.x > (Constants.RegionSize + 10) || // return FALSE if more than 10 meters into a east-adjacent region.
pos.y < -10.0 || // return FALSE if more than 10 meters into a south-adjacent region.
pos.y > (Constants.RegionSize + 10) || // return FALSE if more than 10 meters into a north-adjacent region.
pos.z > 4096 // return FALSE if altitude than 4096m
pos.z > Constants.RegionHeight // return FALSE if altitude than 4096m
)
)
{

View File

@ -101,7 +101,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
public string RegisterRegion(UUID scopeID, GridRegion regionInfo)
{
Vector3d minPosition = new Vector3d(regionInfo.RegionLocX, regionInfo.RegionLocY, 0.0);
Vector3d maxPosition = minPosition + new Vector3d(Constants.RegionSize, Constants.RegionSize, 4096.0);
Vector3d maxPosition = minPosition + new Vector3d(Constants.RegionSize, Constants.RegionSize, Constants.RegionHeight);
OSDMap extraData = new OSDMap
{
@ -286,7 +286,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
List<GridRegion> foundRegions = new List<GridRegion>();
Vector3d minPosition = new Vector3d(xmin, ymin, 0.0);
Vector3d maxPosition = new Vector3d(xmax, ymax, 4096.0);
Vector3d maxPosition = new Vector3d(xmax, ymax, Constants.RegionHeight);
NameValueCollection requestArgs = new NameValueCollection
{