From 6702b0373371fd2a546a580ad82f5cc175fa29e0 Mon Sep 17 00:00:00 2001
From: Jeff Ames
Date: Wed, 19 Dec 2007 08:44:25 +0000
Subject: 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
---
.../Region/Environment/Scenes/AvatarAppearance.cs | 4 +--
OpenSim/Region/Environment/Scenes/ScenePresence.cs | 36 ++++++++++++++--------
2 files changed, 25 insertions(+), 15 deletions(-)
(limited to 'OpenSim/Region/Environment')
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
m_textureEntry = GetDefaultTextureEntry();
}
-
///
///
///
@@ -109,7 +108,6 @@ namespace OpenSim.Region.Environment.Scenes
// (float)m_visualParams[125] = LegLength
m_avatarHeight = (1.50856f + (((float)m_visualParams[25] / 255.0f) * (2.525506f - 1.50856f)))
+ (((float)m_visualParams[125] / 255.0f) / 1.5f);
-
}
///
@@ -119,7 +117,7 @@ namespace OpenSim.Region.Environment.Scenes
public void SendAppearanceToOtherAgent(ScenePresence avatar)
{
avatar.ControllingClient.SendAppearance(m_scenePresenceID, m_visualParams,
- m_textureEntry.ToBytes());
+ m_textureEntry.ToBytes());
}
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
uint neighbourx = m_regionInfo.RegionLocX;
uint neighboury = m_regionInfo.RegionLocY;
- if (pos.X < 1.7F)
+ // distance to edge that will trigger crossing
+ const float boundaryDistance = 1.7f;
+
+ // distance into new region to place avatar
+ const float enterDistance = 0.1f;
+
+ // region size
+ // TODO: this should be hard-coded in some common place
+ const float regionWidth = 256;
+ const float regionHeight = 256;
+
+ if (pos.X < boundaryDistance)
{
- neighbourx -= 1;
- newpos.X = 255.9F;
+ neighbourx--;
+ newpos.X = regionWidth - enterDistance;
}
- if (pos.X > 254.3F)
+ else if (pos.X > regionWidth - boundaryDistance)
{
- neighbourx += 1;
- newpos.X = 0.1F;
+ neighbourx++;
+ newpos.X = enterDistance;
}
- if (pos.Y < 1.7F)
+
+ if (pos.Y < boundaryDistance)
{
- neighboury -= 1;
- newpos.Y = 255.9F;
+ neighboury--;
+ newpos.Y = regionHeight - enterDistance;
}
- if (pos.Y > 254.3F)
+ else if (pos.Y > regionHeight - boundaryDistance)
{
- neighboury += 1;
- newpos.Y = 0.1F;
+ neighboury++;
+ newpos.Y = enterDistance;
}
LLVector3 vel = m_velocity;
--
cgit v1.1