diff options
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 '')
-rw-r--r-- | OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs | 13 |
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 |