24int heightStickWidth,
int heightStickLength,
const void* heightfieldData,
29 initialize(heightStickWidth, heightStickLength, heightfieldData,
30 heightScale, minHeight, maxHeight, upAxis, hdt,
45 btScalar heightScale = maxHeight / 65535;
47 initialize(heightStickWidth, heightStickLength, heightfieldData,
48 heightScale, minHeight, maxHeight, upAxis, hdt,
56int heightStickWidth,
int heightStickLength,
const void* heightfieldData,
137 btVector3 extent = halfExtents.
dot3(abs_b[0], abs_b[1], abs_b[2]);
140 aabbMin = center - extent;
141 aabbMax = center + extent;
244 return (
int) (x - 0.5);
246 return (
int) (x + 0.5);
292 int quantizedAabbMin[3];
293 int quantizedAabbMax[3];
299 for (
int i = 0; i < 3; ++i) {
300 quantizedAabbMin[i]--;
301 quantizedAabbMax[i]++;
313 if (quantizedAabbMin[1]>startX)
314 startX = quantizedAabbMin[1];
315 if (quantizedAabbMax[1]<endX)
316 endX = quantizedAabbMax[1];
317 if (quantizedAabbMin[2]>startJ)
318 startJ = quantizedAabbMin[2];
319 if (quantizedAabbMax[2]<endJ)
320 endJ = quantizedAabbMax[2];
325 if (quantizedAabbMin[0]>startX)
326 startX = quantizedAabbMin[0];
327 if (quantizedAabbMax[0]<endX)
328 endX = quantizedAabbMax[0];
329 if (quantizedAabbMin[2]>startJ)
330 startJ = quantizedAabbMin[2];
331 if (quantizedAabbMax[2]<endJ)
332 endJ = quantizedAabbMax[2];
337 if (quantizedAabbMin[0]>startX)
338 startX = quantizedAabbMin[0];
339 if (quantizedAabbMax[0]<endX)
340 endX = quantizedAabbMax[0];
341 if (quantizedAabbMin[1]>startJ)
342 startJ = quantizedAabbMin[1];
343 if (quantizedAabbMax[1]<endJ)
344 endJ = quantizedAabbMax[1];
357 for(
int j=startJ; j<endJ; j++)
359 for(
int x=startX; x<endX; x++)
@ TERRAIN_SHAPE_PROXYTYPE
PHY_ScalarType
PHY_ScalarType enumerates possible scalar types.
static int getQuantized(btScalar x)
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
virtual btScalar getMargin() const
PHY_ScalarType m_heightDataType
bool m_useZigzagSubdivision
bool m_useDiamondSubdivision
virtual btScalar getRawHeightFieldValue(int x, int y) const
This returns the "raw" (user's initial) height, not the actual height.
const short * m_heightfieldDataShort
virtual void getAabb(const btTransform &t, btVector3 &aabbMin, btVector3 &aabbMax) const
getAabb returns the axis aligned bounding box in the coordinate frame of the given transform t.
void quantizeWithClamp(int *out, const btVector3 &point, int isMax) const
given input vector, return quantized version
virtual ~btHeightfieldTerrainShape()
void getVertex(int x, int y, btVector3 &vertex) const
this returns the vertex in bullet-local coordinates
virtual void calculateLocalInertia(btScalar mass, btVector3 &inertia) const
const void * m_heightfieldDataUnknown
btHeightfieldTerrainShape(int heightStickWidth, int heightStickLength, const void *heightfieldData, btScalar heightScale, btScalar minHeight, btScalar maxHeight, int upAxis, PHY_ScalarType heightDataType, bool flipQuadEdges)
preferred constructor
const unsigned char * m_heightfieldDataUnsignedChar
virtual void setLocalScaling(const btVector3 &scaling)
int m_heightStickWidth
terrain data
virtual void processAllTriangles(btTriangleCallback *callback, const btVector3 &aabbMin, const btVector3 &aabbMax) const
process all triangles within the provided axis-aligned bounding box
const btScalar * m_heightfieldDataFloat
virtual const btVector3 & getLocalScaling() const
void initialize(int heightStickWidth, int heightStickLength, const void *heightfieldData, btScalar heightScale, btScalar minHeight, btScalar maxHeight, int upAxis, PHY_ScalarType heightDataType, bool flipQuadEdges)
protected initialization
The btMatrix3x3 class implements a 3x3 rotation matrix, to perform linear algebra in combination with...
btMatrix3x3 absolute() const
Return the matrix with all values non negative.
The btTriangleCallback provides a callback for each overlapping triangle when calling processAllTrian...
virtual void processTriangle(btVector3 *triangle, int partId, int triangleIndex)=0
btVector3 can be used to represent 3D points and vectors.
const btScalar & getZ() const
Return the z value.
void setMax(const btVector3 &other)
Set each element to the max of the current values and the values of another btVector3.
btVector3 dot3(const btVector3 &v0, const btVector3 &v1, const btVector3 &v2) const
void setValue(const btScalar &_x, const btScalar &_y, const btScalar &_z)
const btScalar & getY() const
Return the y value.
void setMin(const btVector3 &other)
Set each element to the min of the current values and the values of another btVector3.
const btScalar & getX() const
Return the x value.