Bullet 2.67beta problem

helicase
Posts: 5
Joined: Tue Feb 26, 2008 3:53 am

Bullet 2.67beta problem

Post by helicase »

The new code in

btHeightfieldTerrainShape::quantizeWithClamp(...)

Completely breaks my heightfield. Reverting this

Code: Select all

out[0] = (unsigned short)(((unsigned short)v.getX() & 0xffffffe) | isMax);
out[1] = (unsigned short)(((unsigned short)v.getY() & 0xffffffe) | isMax);
out[2] = (unsigned short)(((unsigned short)v.getZ() & 0xffffffe) | isMax);
back to this (2.66):
fixes it.

Code: Select all

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) );
linux 2.6.22
gcc 4.1.3 20070929 (both -O3 and -O1)

Note: I am using a heightfield of floats. The demos (which don't use floats) work.

Code: Select all

btScalar maxHeight = 1000.0f;
  int upAxis = 1;  // y
  bool useFloats = true;
  bool flipQuadEdges = true;

btHeightfieldTerrainShape* terrainShape =
new btHeightfieldTerrainShape(terrain.width(), terrain.height(),
terrain.heights(), maxHeight, upAxis,
useFloats, flipQuadEdges);
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: Bullet 2.67beta problem

Post by Erwin Coumans »

This was a mistake, it has been reverted. We'll get back to this later, to optimize/remove the btFabs.

Thanks for the feedback,
Erwin