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 | |
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')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/AvatarAppearance.cs | 4 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Scenes/ScenePresence.cs | 36 |
2 files changed, 25 insertions, 15 deletions
diff --git a/OpenSim/Region/Environment/Scenes/AvatarAppearance.cs b/OpenSim/Region/Environment/Scenes/AvatarAppearance.cs index b027845..2ec4dbe 100644 --- a/OpenSim/Region/Environment/Scenes/AvatarAppearance.cs +++ b/OpenSim/Region/Environment/Scenes/AvatarAppearance.cs | |||
@@ -88,7 +88,6 @@ namespace OpenSim.Region.Environment.Scenes | |||
88 | m_textureEntry = GetDefaultTextureEntry(); | 88 | m_textureEntry = GetDefaultTextureEntry(); |
89 | } | 89 | } |
90 | 90 | ||
91 | |||
92 | /// <summary> | 91 | /// <summary> |
93 | /// | 92 | /// |
94 | /// </summary> | 93 | /// </summary> |
@@ -109,7 +108,6 @@ namespace OpenSim.Region.Environment.Scenes | |||
109 | // (float)m_visualParams[125] = LegLength | 108 | // (float)m_visualParams[125] = LegLength |
110 | m_avatarHeight = (1.50856f + (((float)m_visualParams[25] / 255.0f) * (2.525506f - 1.50856f))) | 109 | m_avatarHeight = (1.50856f + (((float)m_visualParams[25] / 255.0f) * (2.525506f - 1.50856f))) |
111 | + (((float)m_visualParams[125] / 255.0f) / 1.5f); | 110 | + (((float)m_visualParams[125] / 255.0f) / 1.5f); |
112 | |||
113 | } | 111 | } |
114 | 112 | ||
115 | /// <summary> | 113 | /// <summary> |
@@ -119,7 +117,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
119 | public void SendAppearanceToOtherAgent(ScenePresence avatar) | 117 | public void SendAppearanceToOtherAgent(ScenePresence avatar) |
120 | { | 118 | { |
121 | avatar.ControllingClient.SendAppearance(m_scenePresenceID, m_visualParams, | 119 | avatar.ControllingClient.SendAppearance(m_scenePresenceID, m_visualParams, |
122 | m_textureEntry.ToBytes()); | 120 | m_textureEntry.ToBytes()); |
123 | } | 121 | } |
124 | 122 | ||
125 | public void SetWearable(IClientAPI client, int wearableId, AvatarWearable wearable) | 123 | public void SetWearable(IClientAPI client, int wearableId, AvatarWearable wearable) |
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; |