diff options
author | Justin Clark-Casey (justincc) | 2013-08-12 22:57:32 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2013-08-12 22:57:32 +0100 |
commit | 4f8c691f8c1c56cc74c5f8a6e95d0867dfe4a1a1 (patch) | |
tree | f9e4bb133ee97106561ecffb9f74c384183bd525 /OpenSim/Region/Physics/BulletSPlugin/BSActorAvatarMove.cs | |
parent | Make show bots pCampbot console command print connected, connecting, etc. bot... (diff) | |
parent | BulletSim: add check in avatar stair step code to verify the collision (diff) | |
download | opensim-SC-4f8c691f8c1c56cc74c5f8a6e95d0867dfe4a1a1.zip opensim-SC-4f8c691f8c1c56cc74c5f8a6e95d0867dfe4a1a1.tar.gz opensim-SC-4f8c691f8c1c56cc74c5f8a6e95d0867dfe4a1a1.tar.bz2 opensim-SC-4f8c691f8c1c56cc74c5f8a6e95d0867dfe4a1a1.tar.xz |
Merge branch 'master' of ssh://opensimulator.org/var/git/opensim
Diffstat (limited to 'OpenSim/Region/Physics/BulletSPlugin/BSActorAvatarMove.cs')
-rwxr-xr-x | OpenSim/Region/Physics/BulletSPlugin/BSActorAvatarMove.cs | 33 |
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 | } |