aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/POSPlugin/POSPlugin.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/POSPlugin/POSPlugin.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/POSPlugin/POSPlugin.cs')
-rw-r--r--OpenSim/Region/Physics/POSPlugin/POSPlugin.cs18
1 files changed, 9 insertions, 9 deletions
diff --git a/OpenSim/Region/Physics/POSPlugin/POSPlugin.cs b/OpenSim/Region/Physics/POSPlugin/POSPlugin.cs
index 7652934..3bd25f6 100644
--- a/OpenSim/Region/Physics/POSPlugin/POSPlugin.cs
+++ b/OpenSim/Region/Physics/POSPlugin/POSPlugin.cs
@@ -203,21 +203,21 @@ namespace OpenSim.Region.Physics.POSPlugin
203 { 203 {
204 character.Position.Y = 0.1F; 204 character.Position.Y = 0.1F;
205 } 205 }
206 else if (character.Position.Y >= 256) 206 else if (character.Position.Y >= Constants.RegionSize)
207 { 207 {
208 character.Position.Y = 255.9F; 208 character.Position.Y = Constants.RegionSize - 0.1f;
209 } 209 }
210 210
211 if (character.Position.X < 0) 211 if (character.Position.X < 0)
212 { 212 {
213 character.Position.X = 0.1F; 213 character.Position.X = 0.1F;
214 } 214 }
215 else if (character.Position.X >= 256) 215 else if (character.Position.X >= Constants.RegionSize)
216 { 216 {
217 character.Position.X = 255.9F; 217 character.Position.X = Constants.RegionSize - 0.1f;
218 } 218 }
219 219
220 float terrainheight = _heightMap[(int) character.Position.Y*256 + (int) character.Position.X]; 220 float terrainheight = _heightMap[(int)character.Position.Y * Constants.RegionSize + (int)character.Position.X];
221 if (character.Position.Z + (character._target_velocity.Z*timeStep) < terrainheight + 2) 221 if (character.Position.Z + (character._target_velocity.Z*timeStep) < terrainheight + 2)
222 { 222 {
223 character.Position.Z = terrainheight + 1.0f; 223 character.Position.Z = terrainheight + 1.0f;
@@ -269,18 +269,18 @@ namespace OpenSim.Region.Physics.POSPlugin
269 { 269 {
270 character.Position.Y = 0.1F; 270 character.Position.Y = 0.1F;
271 } 271 }
272 else if (character.Position.Y >= 256) 272 else if (character.Position.Y >= Constants.RegionSize)
273 { 273 {
274 character.Position.Y = 255.9F; 274 character.Position.Y = Constants.RegionSize - 0.1f;
275 } 275 }
276 276
277 if (character.Position.X < 0) 277 if (character.Position.X < 0)
278 { 278 {
279 character.Position.X = 0.1F; 279 character.Position.X = 0.1F;
280 } 280 }
281 else if (character.Position.X >= 256) 281 else if (character.Position.X >= Constants.RegionSize)
282 { 282 {
283 character.Position.X = 255.9F; 283 character.Position.X = Constants.RegionSize - 0.1f;
284 } 284 }
285 285
286 character._velocity.X = (character.Position.X - oldposX)/timeStep; 286 character._velocity.X = (character.Position.X - oldposX)/timeStep;