mirror of
https://github.com/opensim/opensim.git
synced 2026-08-12 20:55:43 +08:00
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
This commit is contained in:
@@ -88,7 +88,6 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
m_textureEntry = GetDefaultTextureEntry();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
@@ -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);
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user