16#ifndef BT_HEIGHTFIELD_TERRAIN_SHAPE_H
17#define BT_HEIGHTFIELD_TERRAIN_SHAPE_H
81 return !(min > other.
max || max < other.
min);
129 virtual btScalar getRawHeightFieldValue(
int x,
int y)
const;
130 void quantizeWithClamp(
int* out,
const btVector3& point,
int isMax)
const;
137 void initialize(
int heightStickWidth,
int heightStickLength,
138 const void* heightfieldData,
btScalar heightScale,
147 int heightStickWidth,
int heightStickLength,
149 int upAxis,
bool flipQuadEdges);
151 int heightStickWidth,
int heightStickLength,
153 int upAxis,
bool flipQuadEdges);
155 int heightStickWidth,
int heightStickLength,
157 int upAxis,
bool flipQuadEdges);
159 int heightStickWidth,
int heightStickLength,
161 int upAxis,
bool flipQuadEdges);
174 const void* heightfieldData,
btScalar heightScale,
186 btHeightfieldTerrainShape(
int heightStickWidth,
int heightStickLength,
const void* heightfieldData,
btScalar maxHeight,
int upAxis,
bool useFloatData,
bool flipQuadEdges);
197 m_flipTriangleWinding = flipTriangleWinding;
205 virtual void setLocalScaling(
const btVector3& scaling);
207 virtual const btVector3& getLocalScaling()
const;
209 void getVertex(
int x,
int y,
btVector3& vertex)
const;
213 void buildAccelerator(
int chunkSize = 16);
214 void clearAccelerator();
221 virtual const char*
getName()
const {
return "HEIGHTFIELD"; }
226 m_userValue3 = value;
234 return m_triangleInfoMap;
238 return m_triangleInfoMap;
242 m_triangleInfoMap = map;
246 return m_heightfieldDataUnsignedChar;
PHY_ScalarType
PHY_ScalarType enumerates possible scalar types.
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
#define ATTRIBUTE_ALIGNED16(a)
The btAlignedObjectArray template class uses a subset of the stl::vector interface for its methods It...
The btConcaveShape class provides an interface for non-moving (static) concave shapes.
btHeightfieldTerrainShape simulates a 2D heightfield terrain
bool m_flipTriangleWinding
void setFlipTriangleWinding(bool flipTriangleWinding)
void setUseZigzagSubdivision(bool useZigzagSubdivision=true)
could help compatibility with Ogre heightfields. See https://code.google.com/p/bullet/issues/detail?...
PHY_ScalarType m_heightDataType
bool m_useZigzagSubdivision
void setUseDiamondSubdivision(bool useDiamondSubdivision=true)
struct btTriangleInfoMap * getTriangleInfoMap()
bool m_useDiamondSubdivision
void setUserValue3(btScalar value)
const short * m_heightfieldDataShort
const double * m_heightfieldDataDouble
const struct btTriangleInfoMap * getTriangleInfoMap() const
btScalar getUserValue3() const
const void * m_heightfieldDataUnknown
const unsigned char * getHeightfieldRawData() const
BT_DECLARE_ALIGNED_ALLOCATOR()
const unsigned char * m_heightfieldDataUnsignedChar
virtual const char * getName() const
const float * m_heightfieldDataFloat
int m_heightStickWidth
terrain data
btAlignedObjectArray< Range > m_vboundsGrid
void setTriangleInfoMap(btTriangleInfoMap *map)
struct btTriangleInfoMap * m_triangleInfoMap
The btTriangleCallback provides a callback for each overlapping triangle when calling processAllTrian...
btVector3 can be used to represent 3D points and vectors.
bool overlaps(const Range &other) const
Range(btScalar min, btScalar max)
The btTriangleInfoMap stores edge angle information for some triangles. You can compute this informat...