aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/POSPlugin/POSScene.cs
diff options
context:
space:
mode:
authoridb2008-12-01 00:49:36 +0000
committeridb2008-12-01 00:49:36 +0000
commit098f16fe3192ef17e7c749a70ea0607a22ae55fa (patch)
treef107a86180f4ebaf7103b466f05c2faeb119cb24 /OpenSim/Region/Physics/POSPlugin/POSScene.cs
parentMantis #2584 (again) (diff)
downloadopensim-SC_OLD-098f16fe3192ef17e7c749a70ea0607a22ae55fa.zip
opensim-SC_OLD-098f16fe3192ef17e7c749a70ea0607a22ae55fa.tar.gz
opensim-SC_OLD-098f16fe3192ef17e7c749a70ea0607a22ae55fa.tar.bz2
opensim-SC_OLD-098f16fe3192ef17e7c749a70ea0607a22ae55fa.tar.xz
Remove duplicated avatar height calculation in lsl functions.
Use height calculation in Basic Physics and Physics of Simplicity so that avatars larger than the default walk with straight legs and shorter walk on the ground.
Diffstat (limited to 'OpenSim/Region/Physics/POSPlugin/POSScene.cs')
-rw-r--r--OpenSim/Region/Physics/POSPlugin/POSScene.cs30
1 files changed, 19 insertions, 11 deletions
diff --git a/OpenSim/Region/Physics/POSPlugin/POSScene.cs b/OpenSim/Region/Physics/POSPlugin/POSScene.cs
index 9771a62..9a4e92f 100644
--- a/OpenSim/Region/Physics/POSPlugin/POSScene.cs
+++ b/OpenSim/Region/Physics/POSPlugin/POSScene.cs
@@ -167,7 +167,7 @@ namespace OpenSim.Region.Physics.POSPlugin
167 float terrainheight = _heightMap[(int)character.Position.Y * Constants.RegionSize + (int)character.Position.X]; 167 float terrainheight = _heightMap[(int)character.Position.Y * Constants.RegionSize + (int)character.Position.X];
168 if (character.Position.Z + (character._target_velocity.Z * timeStep) < terrainheight + 2) 168 if (character.Position.Z + (character._target_velocity.Z * timeStep) < terrainheight + 2)
169 { 169 {
170 character.Position.Z = terrainheight + 1.0f; 170 character.Position.Z = terrainheight + character.Size.Z;
171 forcedZ = true; 171 forcedZ = true;
172 } 172 }
173 else 173 else
@@ -184,23 +184,31 @@ namespace OpenSim.Region.Physics.POSPlugin
184 character.Position.Z = oldposZ; // first try Z axis 184 character.Position.Z = oldposZ; // first try Z axis
185 if (isCollidingWithPrim(character)) 185 if (isCollidingWithPrim(character))
186 { 186 {
187 character.Position.Z = oldposZ + 0.4f; // try harder 187 character.Position.Z = oldposZ + character.Size.Z / 4.4f; // try harder
188 if (isCollidingWithPrim(character)) 188 if (isCollidingWithPrim(character))
189 { 189 {
190 character.Position.X = oldposX; 190 character.Position.Z = oldposZ + character.Size.Z / 2.2f; // try very hard
191 character.Position.Y = oldposY;
192 character.Position.Z = oldposZ;
193
194 character.Position.X += character._target_velocity.X * timeStep;
195 if (isCollidingWithPrim(character)) 191 if (isCollidingWithPrim(character))
196 { 192 {
197 character.Position.X = oldposX; 193 character.Position.X = oldposX;
194 character.Position.Y = oldposY;
195 character.Position.Z = oldposZ;
196
197 character.Position.X += character._target_velocity.X * timeStep;
198 if (isCollidingWithPrim(character))
199 {
200 character.Position.X = oldposX;
201 }
202
203 character.Position.Y += character._target_velocity.Y * timeStep;
204 if (isCollidingWithPrim(character))
205 {
206 character.Position.Y = oldposY;
207 }
198 } 208 }
199 209 else
200 character.Position.Y += character._target_velocity.Y * timeStep;
201 if (isCollidingWithPrim(character))
202 { 210 {
203 character.Position.Y = oldposY; 211 forcedZ = true;
204 } 212 }
205 } 213 }
206 else 214 else