diff options
Diffstat (limited to 'OpenSim/Region/Physics/POSPlugin')
-rw-r--r-- | OpenSim/Region/Physics/POSPlugin/POSPlugin.cs | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/OpenSim/Region/Physics/POSPlugin/POSPlugin.cs b/OpenSim/Region/Physics/POSPlugin/POSPlugin.cs index 4a44438..cc1d16b 100644 --- a/OpenSim/Region/Physics/POSPlugin/POSPlugin.cs +++ b/OpenSim/Region/Physics/POSPlugin/POSPlugin.cs | |||
@@ -178,17 +178,8 @@ namespace OpenSim.Region.Physics.POSPlugin | |||
178 | } | 178 | } |
179 | 179 | ||
180 | bool forcedZ = false; | 180 | bool forcedZ = false; |
181 | character.Position.X = character.Position.X + (character._target_velocity.X * timeStep); | 181 | |
182 | if (check_all_prims(character)) | 182 | float terrainheight = _heightMap[(int)(character.Position.Y + (character._target_velocity.Y * timeStep)) * 256 + (int)(character.Position.X + (character._target_velocity.X * timeStep))]; |
183 | { | ||
184 | character.Position.X = oldposX; | ||
185 | } | ||
186 | character.Position.Y = character.Position.Y + (character._target_velocity.Y * timeStep); | ||
187 | if (check_all_prims(character)) | ||
188 | { | ||
189 | character.Position.Y = oldposY; | ||
190 | } | ||
191 | float terrainheight = _heightMap[(int)character.Position.Y * 256 + (int)character.Position.X]; | ||
192 | if (character.Position.Z + (character._target_velocity.Z * timeStep) < terrainheight + 2) | 183 | if (character.Position.Z + (character._target_velocity.Z * timeStep) < terrainheight + 2) |
193 | { | 184 | { |
194 | character.Position.Z = terrainheight + 1.0f; | 185 | character.Position.Z = terrainheight + 1.0f; |
@@ -208,13 +199,24 @@ namespace OpenSim.Region.Physics.POSPlugin | |||
208 | character.Position.Z = oldposZ; // first try Z axis | 199 | character.Position.Z = oldposZ; // first try Z axis |
209 | if (check_all_prims(character)) | 200 | if (check_all_prims(character)) |
210 | { | 201 | { |
211 | character.Position.Z = oldposZ + 0.4f; // try harder | 202 | character.Position.Z = oldposZ + 0.5f; // try harder |
212 | } | 203 | } |
213 | else | 204 | else |
214 | { | 205 | { |
215 | forcedZ = true; | 206 | forcedZ = true; |
216 | } | 207 | } |
217 | } | 208 | } |
209 | character.Position.X = character.Position.X + (character._target_velocity.X * timeStep); | ||
210 | if (check_all_prims(character)) | ||
211 | { | ||
212 | character.Position.X = oldposX; | ||
213 | } | ||
214 | character.Position.Y = character.Position.Y + (character._target_velocity.Y * timeStep); | ||
215 | if (check_all_prims(character)) | ||
216 | { | ||
217 | character.Position.Y = oldposY; | ||
218 | } | ||
219 | |||
218 | 220 | ||
219 | if (character.Position.Y < 0) | 221 | if (character.Position.Y < 0) |
220 | { | 222 | { |