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:
UbitUmarov
2020-10-12 23:20:37 +01:00
parent c7c82773d0
commit 9773ff42c2
4 changed files with 11 additions and 7 deletions

View File

@@ -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;
}

View File

@@ -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;

View File

@@ -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)