aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r--OpenSim/Framework/Constants.cs9
-rw-r--r--OpenSim/Framework/RegionInfo.cs25
2 files changed, 21 insertions, 13 deletions
diff --git a/OpenSim/Framework/Constants.cs b/OpenSim/Framework/Constants.cs
index a2eb5ee..7979132 100644
--- a/OpenSim/Framework/Constants.cs
+++ b/OpenSim/Framework/Constants.cs
@@ -30,9 +30,18 @@ namespace OpenSim.Framework
30{ 30{
31 public class Constants 31 public class Constants
32 { 32 {
33 // 'RegionSize' captures the legacy region size.
34 // DO NOT USE THIS FOR ANY NEW CODE. Use Scene.RegionSize[XYZ] as a region might not
35 // be the legacy region size.
33 public const uint RegionSize = 256; 36 public const uint RegionSize = 256;
34 public const uint RegionHeight = 4096; 37 public const uint RegionHeight = 4096;
38
39 // Terrain heightmap is kept as shorts that are the float value times this compression factor
40 public const float TerrainCompression = 100.0f;
41 // Since terrain is stored in 16x16 heights, regions must be a multiple of this number and that is the minimum
42 public const int MinRegionSize = 16;
35 public const byte TerrainPatchSize = 16; 43 public const byte TerrainPatchSize = 16;
44
36 public const string DefaultTexture = "89556747-24cb-43ed-920b-47caed15465f"; 45 public const string DefaultTexture = "89556747-24cb-43ed-920b-47caed15465f";
37 46
38 public enum EstateAccessCodex : uint 47 public enum EstateAccessCodex : uint
diff --git a/OpenSim/Framework/RegionInfo.cs b/OpenSim/Framework/RegionInfo.cs
index 2d3c9ea..882fe33 100644
--- a/OpenSim/Framework/RegionInfo.cs
+++ b/OpenSim/Framework/RegionInfo.cs
@@ -472,7 +472,7 @@ namespace OpenSim.Framework
472 /// The x co-ordinate of this region in map tiles (e.g. 1000). 472 /// The x co-ordinate of this region in map tiles (e.g. 1000).
473 /// Coordinate is scaled as world coordinates divided by the legacy region size 473 /// Coordinate is scaled as world coordinates divided by the legacy region size
474 /// and is thus is the number of legacy regions. 474 /// and is thus is the number of legacy regions.
475 /// This entrypoint exists for downward compatability for external modules. 475 /// DO NOT USE FOR NEW CODE! This entrypoint exists for downward compatability with external modules.
476 /// </summary> 476 /// </summary>
477 public uint RegionLocX 477 public uint RegionLocX
478 { 478 {
@@ -480,22 +480,11 @@ namespace OpenSim.Framework
480 set { LegacyRegionLocX = value; } 480 set { LegacyRegionLocX = value; }
481 } 481 }
482 482
483 public void SetDefaultRegionSize()
484 {
485 RegionWorldLocX = 0;
486 RegionWorldLocY = 0;
487 RegionWorldLocZ = 0;
488 RegionSizeX = Constants.RegionSize;
489 RegionSizeY = Constants.RegionSize;
490 RegionSizeZ = Constants.RegionHeight;
491 }
492
493
494 /// <summary> 483 /// <summary>
495 /// The y co-ordinate of this region in map tiles (e.g. 1000). 484 /// The y co-ordinate of this region in map tiles (e.g. 1000).
496 /// Coordinate is scaled as world coordinates divided by the legacy region size 485 /// Coordinate is scaled as world coordinates divided by the legacy region size
497 /// and is thus is the number of legacy regions. 486 /// and is thus is the number of legacy regions.
498 /// This entrypoint exists for downward compatability for external modules. 487 /// DO NOT USE FOR NEW CODE! This entrypoint exists for downward compatability with external modules.
499 /// </summary> 488 /// </summary>
500 public uint RegionLocY 489 public uint RegionLocY
501 { 490 {
@@ -503,6 +492,16 @@ namespace OpenSim.Framework
503 set { LegacyRegionLocY = value; } 492 set { LegacyRegionLocY = value; }
504 } 493 }
505 494
495 public void SetDefaultRegionSize()
496 {
497 RegionWorldLocX = 0;
498 RegionWorldLocY = 0;
499 RegionWorldLocZ = 0;
500 RegionSizeX = Constants.RegionSize;
501 RegionSizeY = Constants.RegionSize;
502 RegionSizeZ = Constants.RegionHeight;
503 }
504
506 // A unique region handle is created from the region's world coordinates. 505 // A unique region handle is created from the region's world coordinates.
507 // This cannot be changed because some code expects to receive the region handle and then 506 // This cannot be changed because some code expects to receive the region handle and then
508 // compute the region coordinates from it. 507 // compute the region coordinates from it.