aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/POSPlugin/POSPlugin.cs
diff options
context:
space:
mode:
authorBrian McBee2007-11-20 04:28:31 +0000
committerBrian McBee2007-11-20 04:28:31 +0000
commitdb3858c13ad0e68e5b51ace9c017d19acec5e136 (patch)
tree9c4328ac0dbdae34b5305641e6170f951fd73156 /OpenSim/Region/Physics/POSPlugin/POSPlugin.cs
parentPOS physics: removed "stickiness" from avatars so they can slide along surfac... (diff)
downloadopensim-SC_OLD-db3858c13ad0e68e5b51ace9c017d19acec5e136.zip
opensim-SC_OLD-db3858c13ad0e68e5b51ace9c017d19acec5e136.tar.gz
opensim-SC_OLD-db3858c13ad0e68e5b51ace9c017d19acec5e136.tar.bz2
opensim-SC_OLD-db3858c13ad0e68e5b51ace9c017d19acec5e136.tar.xz
POS physics. tweaking stair-climbing which broke with my last change
Diffstat (limited to 'OpenSim/Region/Physics/POSPlugin/POSPlugin.cs')
-rw-r--r--OpenSim/Region/Physics/POSPlugin/POSPlugin.cs26
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 {