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:
Jeff Ames
2007-12-19 08:44:25 +00:00
parent bd16dddce5
commit 6702b03733
16 changed files with 136 additions and 155 deletions

View File

@@ -125,8 +125,9 @@ namespace OpenSim.Region.Physics.BasicPhysicsPlugin
{
BasicActor actor = _actors[i];
actor.Position.X = actor.Position.X + (actor.Velocity.X*timeStep);
actor.Position.Y = actor.Position.Y + (actor.Velocity.Y*timeStep);
actor.Position.X += actor.Velocity.X * timeStep;
actor.Position.Y += actor.Velocity.Y * timeStep;
if (actor.Position.Y < 0)
{
actor.Position.Y = 0.1F;
@@ -145,18 +146,18 @@ namespace OpenSim.Region.Physics.BasicPhysicsPlugin
actor.Position.X = 255.9F;
}
float height = _heightMap[(int) actor.Position.Y*256 + (int) actor.Position.X] + 1.0f;
float height = _heightMap[(int) actor.Position.Y * 256 + (int) actor.Position.X] + 1.0f;
if (actor.Flying)
{
if (actor.Position.Z + (actor.Velocity.Z*timeStep) <
_heightMap[(int) actor.Position.Y*256 + (int) actor.Position.X] + 2)
if (actor.Position.Z + (actor.Velocity.Z * timeStep) <
_heightMap[(int) actor.Position.Y * 256 + (int) actor.Position.X] + 2)
{
actor.Position.Z = height;
actor.Velocity.Z = 0;
}
else
{
actor.Position.Z = actor.Position.Z + (actor.Velocity.Z*timeStep);
actor.Position.Z += actor.Velocity.Z * timeStep;
}
}
else