From f3afa68a2af6ad5999e6efe3e4725cb17293108d Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Thu, 14 Feb 2008 12:16:33 +0000 Subject: * Made new Framework.Constants class, added RegionSize member. * Converted all instances of "256" spotted to use RegionSize instead. Some approximations used for border crossings (ie 255.9f) are still using that value, but should be updated to use something based on RegionSize. * Moving Terrain to a RegionModule, implemented ITerrainChannel and TerrainModule - nonfunctional, but will be soon. --- OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'OpenSim/Region/Physics/BasicPhysicsPlugin') diff --git a/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs b/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs index a32bca5..d767eab 100644 --- a/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs +++ b/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs @@ -137,7 +137,7 @@ namespace OpenSim.Region.Physics.BasicPhysicsPlugin { actor.Position.Y = 0.1F; } - else if (actor.Position.Y >= 256) + else if (actor.Position.Y >= Constants.RegionSize) { actor.Position.Y = 255.9F; } @@ -146,16 +146,16 @@ namespace OpenSim.Region.Physics.BasicPhysicsPlugin { actor.Position.X = 0.1F; } - else if (actor.Position.X >= 256) + else if (actor.Position.X >= Constants.RegionSize) { actor.Position.X = 255.9F; } - float height = _heightMap[(int) actor.Position.Y*256 + (int) actor.Position.X] + 1.0f; + float height = _heightMap[(int)actor.Position.Y * Constants.RegionSize + (int)actor.Position.X] + 1.0f; if (actor.Flying) { if (actor.Position.Z + (actor.Velocity.Z*timeStep) < - _heightMap[(int) actor.Position.Y*256 + (int) actor.Position.X] + 2) + _heightMap[(int)actor.Position.Y * Constants.RegionSize + (int)actor.Position.X] + 2) { actor.Position.Z = height; actor.Velocity.Z = 0; -- cgit v1.1