export btHeightfieldTerrainShape to PyBullet. Note that tinyrenderer doesn't support rendering it (it would be too slow on CPU)

fix rare getKeyboardEvents threading issue
change texture color to default plane.urdf blue
This commit is contained in:
Erwin Coumans
2019-07-29 20:29:07 -07:00
parent 51fba6f78d
commit d58a85fec4

View File

@@ -485,13 +485,16 @@ getRawHeightfieldData
btAssert(raw && "out of memory");
byte_t * p = raw;
for (int i = 0; i < width; ++i)
for (int j = 0; j < width; ++j)
{
float x = i * s_gridSpacing;
for (int j = 0; j < width; ++j)
for (int i = 0; i < width; ++i)
{
float x = i * s_gridSpacing;
float y = j * s_gridSpacing;
float z = double(image[i*3+width*j*3])*(14./256.);
float heightScaling = (14. / 256.);
float z = double(image[(width - 1 - i) * 3 + width*j * 3]) * heightScaling;
convertFromFloat(p, z, type);
// update min/max
if (!i && !j) {