mirror of
https://github.com/opensim/opensim.git
synced 2026-08-09 02:36:00 +08:00
This is the second part of the 'not crash on regionsize changes'. This lets you configure region sizes to be smaller without crashing the region. I remind you that regions are still square, must be a multiple of 4, and the Linden client doesn't like anything other then 256. If you set it bigger or smaller, the terrain doesn't load in the client, the map has issues, and god forbid you connect it to a grid that expects 256m regions.
This commit is contained in:
@@ -144,7 +144,7 @@ namespace OpenSim.Region.Physics.BasicPhysicsPlugin
|
||||
}
|
||||
else if (actor.Position.Y >= Constants.RegionSize)
|
||||
{
|
||||
actor.Position.Y = 255.9F;
|
||||
actor.Position.Y = ((int)Constants.RegionSize - 0.1f);
|
||||
}
|
||||
|
||||
if (actor.Position.X < 0)
|
||||
@@ -153,7 +153,7 @@ namespace OpenSim.Region.Physics.BasicPhysicsPlugin
|
||||
}
|
||||
else if (actor.Position.X >= Constants.RegionSize)
|
||||
{
|
||||
actor.Position.X = 255.9F;
|
||||
actor.Position.X = ((int)Constants.RegionSize - 0.1f);
|
||||
}
|
||||
|
||||
float height = _heightMap[(int)actor.Position.Y * Constants.RegionSize + (int)actor.Position.X] + actor.Size.Z;
|
||||
|
||||
@@ -2476,7 +2476,7 @@ namespace OpenSim.Region.Physics.BulletDotNETPlugin
|
||||
l_orientation.Z = tempOrientation2.getZ();
|
||||
l_orientation.W = tempOrientation2.getW();
|
||||
|
||||
if (l_position.X > 255.95f || l_position.X < 0f || l_position.Y > 255.95f || l_position.Y < 0f)
|
||||
if (l_position.X > ((int)Constants.RegionSize - 0.05f) || l_position.X < 0f || l_position.Y > ((int)Constants.RegionSize - 0.05f) || l_position.Y < 0f)
|
||||
{
|
||||
//base.RaiseOutOfBounds(l_position);
|
||||
|
||||
|
||||
@@ -161,7 +161,7 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||
}
|
||||
else
|
||||
{
|
||||
_position = new PhysicsVector(128,128,parent_scene.GetTerrainHeightAtXY(128,128) + 10);
|
||||
_position = new PhysicsVector(((int)Constants.RegionSize * 0.5f), ((int)Constants.RegionSize * 0.5f), parent_scene.GetTerrainHeightAtXY(128, 128) + 10);
|
||||
m_taintPosition.X = _position.X;
|
||||
m_taintPosition.Y = _position.Y;
|
||||
m_taintPosition.Z = _position.Z;
|
||||
|
||||
@@ -181,7 +181,7 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||
_velocity = new PhysicsVector();
|
||||
if (!PhysicsVector.isFinite(pos))
|
||||
{
|
||||
pos = new PhysicsVector(128, 128, parent_scene.GetTerrainHeightAtXY(128, 128) + 0.5f);
|
||||
pos = new PhysicsVector(((int)Constants.RegionSize * 0.5f), ((int)Constants.RegionSize * 0.5f), parent_scene.GetTerrainHeightAtXY(((int)Constants.RegionSize * 0.5f), ((int)Constants.RegionSize * 0.5f)) + 0.5f);
|
||||
m_log.Warn("[PHYSICS]: Got nonFinite Object create Position");
|
||||
}
|
||||
_position = pos;
|
||||
@@ -2538,7 +2538,7 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||
l_orientation.Z = ori.Z;
|
||||
l_orientation.W = ori.W;
|
||||
|
||||
if (l_position.X > 255.95f || l_position.X < 0f || l_position.Y > 255.95f || l_position.Y < 0f)
|
||||
if (l_position.X > ((int)Constants.RegionSize - 0.05f) || l_position.X < 0f || l_position.Y > ((int)Constants.RegionSize - 0.05f) || l_position.Y < 0f)
|
||||
{
|
||||
//base.RaiseOutOfBounds(l_position);
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||
public void CreateAndDropPhysicalCube()
|
||||
{
|
||||
PrimitiveBaseShape newcube = PrimitiveBaseShape.CreateBox();
|
||||
PhysicsVector position = new PhysicsVector(128, 128, 128);
|
||||
PhysicsVector position = new PhysicsVector(((int)Constants.RegionSize * 0.5f), ((int)Constants.RegionSize * 0.5f), 128);
|
||||
PhysicsVector size = new PhysicsVector(0.5f, 0.5f, 0.5f);
|
||||
Quaternion rot = Quaternion.Identity;
|
||||
PhysicsActor prim = ps.AddPrimShape("CoolShape", newcube, position, size, rot, true);
|
||||
|
||||
Reference in New Issue
Block a user