From 2cb1d5240e41639b9c84aa6607aab0df49f353a7 Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Sun, 20 Jan 2013 13:11:00 -0800 Subject: BulletSim: small fix making sure terrain height is calculated properly if the vehicle moves during vehicle actions. --- OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/Physics') 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 // Since the computation of terrain height can be a little involved, this routine // is used to fetch the height only once for each vehicle simulation step. + Vector3 lastRememberedHeightPos; private float GetTerrainHeight(Vector3 pos) { - if ((m_knownHas & m_knownChangedTerrainHeight) == 0) + if ((m_knownHas & m_knownChangedTerrainHeight) == 0 || pos != lastRememberedHeightPos) { + lastRememberedHeightPos = pos; m_knownTerrainHeight = Prim.PhysicsScene.TerrainManager.GetTerrainHeightAtXYZ(pos); m_knownHas |= m_knownChangedTerrainHeight; } -- cgit v1.1