diff options
author | Robert Adams | 2013-01-20 13:11:00 -0800 |
---|---|---|
committer | Robert Adams | 2013-01-20 23:09:54 -0800 |
commit | 2cb1d5240e41639b9c84aa6607aab0df49f353a7 (patch) | |
tree | 392a1ea69cfc2e7d56ffdd08a8146ddf6c481567 /OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs | |
parent | BulletSim: modify motors to return correction rather than current value (diff) | |
download | opensim-SC-2cb1d5240e41639b9c84aa6607aab0df49f353a7.zip opensim-SC-2cb1d5240e41639b9c84aa6607aab0df49f353a7.tar.gz opensim-SC-2cb1d5240e41639b9c84aa6607aab0df49f353a7.tar.bz2 opensim-SC-2cb1d5240e41639b9c84aa6607aab0df49f353a7.tar.xz |
BulletSim: small fix making sure terrain height is calculated
properly if the vehicle moves during vehicle actions.
Diffstat (limited to '')
-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 | } |