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:
@@ -485,13 +485,16 @@ getRawHeightfieldData
|
|||||||
btAssert(raw && "out of memory");
|
btAssert(raw && "out of memory");
|
||||||
|
|
||||||
byte_t * p = raw;
|
byte_t * p = raw;
|
||||||
|
|
||||||
|
for (int j = 0; j < width; ++j)
|
||||||
|
{
|
||||||
|
|
||||||
for (int i = 0; i < width; ++i)
|
for (int i = 0; i < width; ++i)
|
||||||
{
|
{
|
||||||
float x = i * s_gridSpacing;
|
float x = i * s_gridSpacing;
|
||||||
for (int j = 0; j < width; ++j)
|
|
||||||
{
|
|
||||||
float y = j * 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);
|
convertFromFloat(p, z, type);
|
||||||
// update min/max
|
// update min/max
|
||||||
if (!i && !j) {
|
if (!i && !j) {
|
||||||
|
|||||||
Reference in New Issue
Block a user