aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/BulletSPlugin/BSActorAvatarMove.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Physics/BulletSPlugin/BSActorAvatarMove.cs')
-rwxr-xr-xOpenSim/Region/Physics/BulletSPlugin/BSActorAvatarMove.cs33
1 files changed, 20 insertions, 13 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSActorAvatarMove.cs b/OpenSim/Region/Physics/BulletSPlugin/BSActorAvatarMove.cs
index 0f11c4a..5f232a4 100755
--- a/OpenSim/Region/Physics/BulletSPlugin/BSActorAvatarMove.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSActorAvatarMove.cs
@@ -311,21 +311,28 @@ public class BSActorAvatarMove : BSActor
311 // Don't care about collisions with the terrain 311 // Don't care about collisions with the terrain
312 if (kvp.Key > m_physicsScene.TerrainManager.HighestTerrainID) 312 if (kvp.Key > m_physicsScene.TerrainManager.HighestTerrainID)
313 { 313 {
314 OMV.Vector3 touchPosition = kvp.Value.Position; 314 BSPhysObject collisionObject;
315 m_physicsScene.DetailLog("{0},BSCharacter.WalkUpStairs,min={1},max={2},touch={3}", 315 if (m_physicsScene.PhysObjects.TryGetValue(kvp.Key, out collisionObject))
316 m_controllingPrim.LocalID, nearFeetHeightMin, nearFeetHeightMax, touchPosition);
317 if (touchPosition.Z >= nearFeetHeightMin && touchPosition.Z <= nearFeetHeightMax)
318 { 316 {
319 // This contact is within the 'near the feet' range. 317 if (!collisionObject.IsVolumeDetect)
320 // The normal should be our contact point to the object so it is pointing away
321 // thus the difference between our facing orientation and the normal should be small.
322 OMV.Vector3 directionFacing = OMV.Vector3.UnitX * m_controllingPrim.RawOrientation;
323 OMV.Vector3 touchNormal = OMV.Vector3.Normalize(kvp.Value.SurfaceNormal);
324 float diff = Math.Abs(OMV.Vector3.Distance(directionFacing, touchNormal));
325 if (diff < BSParam.AvatarStepApproachFactor)
326 { 318 {
327 if (highestTouchPosition.Z < touchPosition.Z) 319 OMV.Vector3 touchPosition = kvp.Value.Position;
328 highestTouchPosition = touchPosition; 320 m_physicsScene.DetailLog("{0},BSCharacter.WalkUpStairs,min={1},max={2},touch={3}",
321 m_controllingPrim.LocalID, nearFeetHeightMin, nearFeetHeightMax, touchPosition);
322 if (touchPosition.Z >= nearFeetHeightMin && touchPosition.Z <= nearFeetHeightMax)
323 {
324 // This contact is within the 'near the feet' range.
325 // The normal should be our contact point to the object so it is pointing away
326 // thus the difference between our facing orientation and the normal should be small.
327 OMV.Vector3 directionFacing = OMV.Vector3.UnitX * m_controllingPrim.RawOrientation;
328 OMV.Vector3 touchNormal = OMV.Vector3.Normalize(kvp.Value.SurfaceNormal);
329 float diff = Math.Abs(OMV.Vector3.Distance(directionFacing, touchNormal));
330 if (diff < BSParam.AvatarStepApproachFactor)
331 {
332 if (highestTouchPosition.Z < touchPosition.Z)
333 highestTouchPosition = touchPosition;
334 }
335 }
329 } 336 }
330 } 337 }
331 } 338 }