aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs
diff options
context:
space:
mode:
authorAdam Frisby2008-02-14 12:16:33 +0000
committerAdam Frisby2008-02-14 12:16:33 +0000
commitf3afa68a2af6ad5999e6efe3e4725cb17293108d (patch)
tree4253a44bee39976d6b3dd6813439f5966cf12632 /OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs
parent* Exposed AddHandlers in response to mantis #534. Thanks, kmeisthax! (diff)
downloadopensim-SC-f3afa68a2af6ad5999e6efe3e4725cb17293108d.zip
opensim-SC-f3afa68a2af6ad5999e6efe3e4725cb17293108d.tar.gz
opensim-SC-f3afa68a2af6ad5999e6efe3e4725cb17293108d.tar.bz2
opensim-SC-f3afa68a2af6ad5999e6efe3e4725cb17293108d.tar.xz
* 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.
Diffstat (limited to 'OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs')
-rw-r--r--OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs8
1 files changed, 4 insertions, 4 deletions
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
137 { 137 {
138 actor.Position.Y = 0.1F; 138 actor.Position.Y = 0.1F;
139 } 139 }
140 else if (actor.Position.Y >= 256) 140 else if (actor.Position.Y >= Constants.RegionSize)
141 { 141 {
142 actor.Position.Y = 255.9F; 142 actor.Position.Y = 255.9F;
143 } 143 }
@@ -146,16 +146,16 @@ namespace OpenSim.Region.Physics.BasicPhysicsPlugin
146 { 146 {
147 actor.Position.X = 0.1F; 147 actor.Position.X = 0.1F;
148 } 148 }
149 else if (actor.Position.X >= 256) 149 else if (actor.Position.X >= Constants.RegionSize)
150 { 150 {
151 actor.Position.X = 255.9F; 151 actor.Position.X = 255.9F;
152 } 152 }
153 153
154 float height = _heightMap[(int) actor.Position.Y*256 + (int) actor.Position.X] + 1.0f; 154 float height = _heightMap[(int)actor.Position.Y * Constants.RegionSize + (int)actor.Position.X] + 1.0f;
155 if (actor.Flying) 155 if (actor.Flying)
156 { 156 {
157 if (actor.Position.Z + (actor.Velocity.Z*timeStep) < 157 if (actor.Position.Z + (actor.Velocity.Z*timeStep) <
158 _heightMap[(int) actor.Position.Y*256 + (int) actor.Position.X] + 2) 158 _heightMap[(int)actor.Position.Y * Constants.RegionSize + (int)actor.Position.X] + 2)
159 { 159 {
160 actor.Position.Z = height; 160 actor.Position.Z = height;
161 actor.Velocity.Z = 0; 161 actor.Velocity.Z = 0;