diff options
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs b/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs index 7c9b83b..388d4f9 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs | |||
@@ -720,10 +720,12 @@ namespace OpenSim.Region.Physics.BulletSPlugin | |||
720 | 720 | ||
721 | // Since the computation of terrain height can be a little involved, this routine | 721 | // Since the computation of terrain height can be a little involved, this routine |
722 | // is used to fetch the height only once for each vehicle simulation step. | 722 | // is used to fetch the height only once for each vehicle simulation step. |
723 | Vector3 lastRememberedHeightPos; | ||
723 | private float GetTerrainHeight(Vector3 pos) | 724 | private float GetTerrainHeight(Vector3 pos) |
724 | { | 725 | { |
725 | if ((m_knownHas & m_knownChangedTerrainHeight) == 0) | 726 | if ((m_knownHas & m_knownChangedTerrainHeight) == 0 || pos != lastRememberedHeightPos) |
726 | { | 727 | { |
728 | lastRememberedHeightPos = pos; | ||
727 | m_knownTerrainHeight = Prim.PhysicsScene.TerrainManager.GetTerrainHeightAtXYZ(pos); | 729 | m_knownTerrainHeight = Prim.PhysicsScene.TerrainManager.GetTerrainHeightAtXYZ(pos); |
728 | m_knownHas |= m_knownChangedTerrainHeight; | 730 | m_knownHas |= m_knownChangedTerrainHeight; |
729 | } | 731 | } |