mirror of
https://github.com/bulletphysics/bullet3
synced 2025-01-11 01:40:10 +00:00
fix for heightfield, thanks SMJ/Spangle and Jay Lee for testing.
http://www.bulletphysics.com/Bullet/phpBB3/viewtopic.php?f=9&t=1482
This commit is contained in:
parent
b5a498e8bf
commit
239d88985f
@ -190,11 +190,11 @@ void btHeightfieldTerrainShape::quantizeWithClamp(int* out, const btVector3& poi
|
||||
|
||||
btVector3 v = (clampedPoint );// * m_quantization;
|
||||
|
||||
out[0] = (int)(v.getX());
|
||||
out[1] = (int)(v.getY());
|
||||
out[2] = (int)(v.getZ());
|
||||
//correct for
|
||||
|
||||
// SMJ - Add 0.5 in the correct direction before doing the int conversion.
|
||||
out[0] = (int)(v.getX() + v.getX() / btFabs(v.getX())* btScalar(0.5) );
|
||||
out[1] = (int)(v.getY() + v.getY() / btFabs(v.getY())* btScalar(0.5) );
|
||||
out[2] = (int)(v.getZ() + v.getZ() / btFabs(v.getZ())* btScalar(0.5) );
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user