mirror of
https://github.com/opensim/opensim.git
synced 2026-08-01 06:06:06 +08:00
define constants for simulation height (-100,50000m) and terrain heightmap (-100,4000). No option. compile time decision. use them at ubOde
This commit is contained in:
@@ -43,9 +43,15 @@ namespace OpenSim.Framework
|
||||
public const uint MaximumRegionSize = 4096;
|
||||
|
||||
// Since terrain is stored in 16x16 heights, regions must be a multiple of this number and that is the minimum
|
||||
public const int MinRegionSize = 16;
|
||||
// but for placement on a grid min must be 256m
|
||||
public const int MinRegionSize = 256;
|
||||
public const int TerrainPatchSize = 16;
|
||||
|
||||
public const float MinSimulationHeight = -100f;
|
||||
public const float MaxSimulationHeight = 50000f;
|
||||
public const float MinTerrainHeightmap = -100f;
|
||||
public const float MaxTerrainHeightmap = 4000f;
|
||||
|
||||
public const string DefaultTexture = "89556747-24cb-43ed-920b-47caed15465f";
|
||||
|
||||
public static readonly UUID m_MrOpenSimID = new UUID("11111111-1111-0000-0000-000100bba000");
|
||||
|
||||
@@ -177,11 +177,11 @@ namespace OpenSim.Region.PhysicsModule.ubOde
|
||||
|
||||
if(pos.IsFinite())
|
||||
{
|
||||
if(pos.Z > 99999f)
|
||||
if(pos.Z > Constants.MaxSimulationHeight)
|
||||
{
|
||||
pos.Z = parent_scene.GetTerrainHeightAtXY(127,127) + 5;
|
||||
}
|
||||
if(pos.Z < -100f) // shouldn't this be 0 ?
|
||||
if(pos.Z < Constants.MinSimulationHeight) // shouldn't this be 0 ?
|
||||
{
|
||||
pos.Z = parent_scene.GetTerrainHeightAtXY(127,127) + 5;
|
||||
}
|
||||
|
||||
@@ -987,7 +987,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
|
||||
{
|
||||
_position.X = Util.Clip(_position.X, 0.5f, _parent_scene.WorldExtents.X - 0.5f);
|
||||
_position.Y = Util.Clip(_position.Y, 0.5f, _parent_scene.WorldExtents.Y - 0.5f);
|
||||
_position.Z = Util.Clip(_position.Z + 0.2f, -100f, 50000f);
|
||||
_position.Z = Util.Clip(_position.Z + 0.2f, Constants.MinSimulationHeight, Constants.MaxSimulationHeight);
|
||||
|
||||
m_lastposition = _position;
|
||||
_velocity.X = 0;
|
||||
|
||||
@@ -2068,9 +2068,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
|
||||
if (x > 1 && x < maxXX)
|
||||
xx++;
|
||||
|
||||
val = heightMap[yy + xx];
|
||||
if (val < -100.0f)
|
||||
val = -100.0f;
|
||||
val = Util.Clamp(heightMap[yy + xx], Constants.MinTerrainHeightmap, Constants.MaxTerrainHeightmap);
|
||||
if(val > maxH)
|
||||
maxH = val;
|
||||
if(val < minH)
|
||||
|
||||
Reference in New Issue
Block a user