From a0c5401033f15cc963cec9870650e313307f53ff Mon Sep 17 00:00:00 2001 From: ejcoumans Date: Thu, 28 Jun 2007 00:05:14 +0000 Subject: [PATCH] bugfix, wrongly assigned value to a local variable (copy/paste bug). Thanks binofet, see http://continuousphysics.com/Bullet/phpBB2/viewtopic.php?t=366 --- .../CollisionShapes/btHeightfieldTerrainShape.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/BulletCollision/CollisionShapes/btHeightfieldTerrainShape.cpp b/src/BulletCollision/CollisionShapes/btHeightfieldTerrainShape.cpp index 4e64aef3c..db92702ee 100644 --- a/src/BulletCollision/CollisionShapes/btHeightfieldTerrainShape.cpp +++ b/src/BulletCollision/CollisionShapes/btHeightfieldTerrainShape.cpp @@ -115,11 +115,11 @@ btScalar btHeightfieldTerrainShape::getHeightFieldValue(int x,int y) const btScalar val = 0.f; if (m_useFloatData) { - btScalar val = m_heightfieldDataFloat[(y*m_width)+x]; + val = m_heightfieldDataFloat[(y*m_width)+x]; } else { unsigned char heightFieldValue = m_heightfieldDataUnsignedChar[(y*m_width)+x]; - btScalar val = heightFieldValue* (m_maxHeight/btScalar(65535)); + val = heightFieldValue* (m_maxHeight/btScalar(65535)); } return val; }