aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/BasicPhysicsPlugin
diff options
context:
space:
mode:
authorJeff Ames2007-12-19 08:44:25 +0000
committerJeff Ames2007-12-19 08:44:25 +0000
commit6702b0373371fd2a546a580ad82f5cc175fa29e0 (patch)
treef2750d5be494d2a976cb583476c4f32ef3d895d7 /OpenSim/Region/Physics/BasicPhysicsPlugin
parent*Added Ban Lines around parcels for banned avatars, but there is no actual bl... (diff)
downloadopensim-SC-6702b0373371fd2a546a580ad82f5cc175fa29e0.zip
opensim-SC-6702b0373371fd2a546a580ad82f5cc175fa29e0.tar.gz
opensim-SC-6702b0373371fd2a546a580ad82f5cc175fa29e0.tar.bz2
opensim-SC-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/Physics/BasicPhysicsPlugin')
-rw-r--r--OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs13
1 files changed, 7 insertions, 6 deletions
diff --git a/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs b/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs
index df3ebb9..545f461 100644
--- a/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs
+++ b/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs
@@ -125,8 +125,9 @@ namespace OpenSim.Region.Physics.BasicPhysicsPlugin
125 { 125 {
126 BasicActor actor = _actors[i]; 126 BasicActor actor = _actors[i];
127 127
128 actor.Position.X = actor.Position.X + (actor.Velocity.X*timeStep); 128 actor.Position.X += actor.Velocity.X * timeStep;
129 actor.Position.Y = actor.Position.Y + (actor.Velocity.Y*timeStep); 129 actor.Position.Y += actor.Velocity.Y * timeStep;
130
130 if (actor.Position.Y < 0) 131 if (actor.Position.Y < 0)
131 { 132 {
132 actor.Position.Y = 0.1F; 133 actor.Position.Y = 0.1F;
@@ -145,18 +146,18 @@ namespace OpenSim.Region.Physics.BasicPhysicsPlugin
145 actor.Position.X = 255.9F; 146 actor.Position.X = 255.9F;
146 } 147 }
147 148
148 float height = _heightMap[(int) actor.Position.Y*256 + (int) actor.Position.X] + 1.0f; 149 float height = _heightMap[(int) actor.Position.Y * 256 + (int) actor.Position.X] + 1.0f;
149 if (actor.Flying) 150 if (actor.Flying)
150 { 151 {
151 if (actor.Position.Z + (actor.Velocity.Z*timeStep) < 152 if (actor.Position.Z + (actor.Velocity.Z * timeStep) <
152 _heightMap[(int) actor.Position.Y*256 + (int) actor.Position.X] + 2) 153 _heightMap[(int) actor.Position.Y * 256 + (int) actor.Position.X] + 2)
153 { 154 {
154 actor.Position.Z = height; 155 actor.Position.Z = height;
155 actor.Velocity.Z = 0; 156 actor.Velocity.Z = 0;
156 } 157 }
157 else 158 else
158 { 159 {
159 actor.Position.Z = actor.Position.Z + (actor.Velocity.Z*timeStep); 160 actor.Position.Z += actor.Velocity.Z * timeStep;
160 } 161 }
161 } 162 }
162 else 163 else