diff options
author | Robert Adams | 2013-08-12 13:44:53 -0700 |
---|---|---|
committer | Robert Adams | 2013-08-12 13:44:53 -0700 |
commit | 2c31fe4614fc193f2600b36eac892ceee86f61e0 (patch) | |
tree | 3a986998ebbd3278e848bb61fc5787f6410f9838 /OpenSim/Region/Physics/BulletSPlugin/BSActorAvatarMove.cs | |
parent | Don't try and send group updates to NPCs via event queue, since NPCs have no ... (diff) | |
download | opensim-SC_OLD-2c31fe4614fc193f2600b36eac892ceee86f61e0.zip opensim-SC_OLD-2c31fe4614fc193f2600b36eac892ceee86f61e0.tar.gz opensim-SC_OLD-2c31fe4614fc193f2600b36eac892ceee86f61e0.tar.bz2 opensim-SC_OLD-2c31fe4614fc193f2600b36eac892ceee86f61e0.tar.xz |
BulletSim: add check in avatar stair step code to verify the collision
is not with a volume detect object.
This fixes a problem of avatars trying to step over a volume detect object
that they collide with. This appeared as the avatar popping up as it started
to step up but then continuing on since the object wasn't physically interacting.
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 | } |