diff options
author | Jeff Ames | 2007-12-19 08:44:25 +0000 |
---|---|---|
committer | Jeff Ames | 2007-12-19 08:44:25 +0000 |
commit | 6702b0373371fd2a546a580ad82f5cc175fa29e0 (patch) | |
tree | f2750d5be494d2a976cb583476c4f32ef3d895d7 /OpenSim/Region/Environment/Scenes/ScenePresence.cs | |
parent | *Added Ban Lines around parcels for banned avatars, but there is no actual bl... (diff) | |
download | opensim-SC_OLD-6702b0373371fd2a546a580ad82f5cc175fa29e0.zip opensim-SC_OLD-6702b0373371fd2a546a580ad82f5cc175fa29e0.tar.gz opensim-SC_OLD-6702b0373371fd2a546a580ad82f5cc175fa29e0.tar.bz2 opensim-SC_OLD-6702b0373371fd2a546a580ad82f5cc175fa29e0.tar.xz |
Misc. cleanup:
* added Util.Clip(value, min, max)
* modified asset cache's numPackets calculation to use max packet size (600) instead of 1000
* removed a few magic numbers
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/ScenePresence.cs')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/ScenePresence.cs | 36 |
1 files changed, 24 insertions, 12 deletions
diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs index 91b6463..89701d7 100644 --- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs | |||
@@ -1233,25 +1233,37 @@ namespace OpenSim.Region.Environment.Scenes | |||
1233 | uint neighbourx = m_regionInfo.RegionLocX; | 1233 | uint neighbourx = m_regionInfo.RegionLocX; |
1234 | uint neighboury = m_regionInfo.RegionLocY; | 1234 | uint neighboury = m_regionInfo.RegionLocY; |
1235 | 1235 | ||
1236 | if (pos.X < 1.7F) | 1236 | // distance to edge that will trigger crossing |
1237 | const float boundaryDistance = 1.7f; | ||
1238 | |||
1239 | // distance into new region to place avatar | ||
1240 | const float enterDistance = 0.1f; | ||
1241 | |||
1242 | // region size | ||
1243 | // TODO: this should be hard-coded in some common place | ||
1244 | const float regionWidth = 256; | ||
1245 | const float regionHeight = 256; | ||
1246 | |||
1247 | if (pos.X < boundaryDistance) | ||
1237 | { | 1248 | { |
1238 | neighbourx -= 1; | 1249 | neighbourx--; |
1239 | newpos.X = 255.9F; | 1250 | newpos.X = regionWidth - enterDistance; |
1240 | } | 1251 | } |
1241 | if (pos.X > 254.3F) | 1252 | else if (pos.X > regionWidth - boundaryDistance) |
1242 | { | 1253 | { |
1243 | neighbourx += 1; | 1254 | neighbourx++; |
1244 | newpos.X = 0.1F; | 1255 | newpos.X = enterDistance; |
1245 | } | 1256 | } |
1246 | if (pos.Y < 1.7F) | 1257 | |
1258 | if (pos.Y < boundaryDistance) | ||
1247 | { | 1259 | { |
1248 | neighboury -= 1; | 1260 | neighboury--; |
1249 | newpos.Y = 255.9F; | 1261 | newpos.Y = regionHeight - enterDistance; |
1250 | } | 1262 | } |
1251 | if (pos.Y > 254.3F) | 1263 | else if (pos.Y > regionHeight - boundaryDistance) |
1252 | { | 1264 | { |
1253 | neighboury += 1; | 1265 | neighboury++; |
1254 | newpos.Y = 0.1F; | 1266 | newpos.Y = enterDistance; |
1255 | } | 1267 | } |
1256 | 1268 | ||
1257 | LLVector3 vel = m_velocity; | 1269 | LLVector3 vel = m_velocity; |