diff options
Diffstat (limited to 'thirdparty/bullet/BulletCollision/CollisionShapes/btHeightfieldTerrainShape.h')
-rw-r--r-- | thirdparty/bullet/BulletCollision/CollisionShapes/btHeightfieldTerrainShape.h | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/thirdparty/bullet/BulletCollision/CollisionShapes/btHeightfieldTerrainShape.h b/thirdparty/bullet/BulletCollision/CollisionShapes/btHeightfieldTerrainShape.h index e23b548cb2..43e1d25e3d 100644 --- a/thirdparty/bullet/BulletCollision/CollisionShapes/btHeightfieldTerrainShape.h +++ b/thirdparty/bullet/BulletCollision/CollisionShapes/btHeightfieldTerrainShape.h @@ -17,7 +17,7 @@ subject to the following restrictions: #define BT_HEIGHTFIELD_TERRAIN_SHAPE_H #include "btConcaveShape.h" - +#include "LinearMath/btAlignedObjectArray.h" ///btHeightfieldTerrainShape simulates a 2D heightfield terrain /** @@ -73,7 +73,8 @@ ATTRIBUTE_ALIGNED16(class) btHeightfieldTerrainShape : public btConcaveShape { public: - struct Range { + struct Range + { btScalar min; btScalar max; }; @@ -102,13 +103,13 @@ protected: bool m_flipQuadEdges; bool m_useDiamondSubdivision; bool m_useZigzagSubdivision; - + bool m_flipTriangleWinding; int m_upAxis; btVector3 m_localScaling; // Accelerator - Range *m_vboundsGrid; + btAlignedObjectArray<Range> m_vboundsGrid; int m_vboundsGridWidth; int m_vboundsGridLength; int m_vboundsChunkSize; @@ -157,6 +158,10 @@ public: ///could help compatibility with Ogre heightfields. See https://code.google.com/p/bullet/issues/detail?id=625 void setUseZigzagSubdivision(bool useZigzagSubdivision = true) { m_useZigzagSubdivision = useZigzagSubdivision; } + void setFlipTriangleWinding(bool flipTriangleWinding) + { + m_flipTriangleWinding = flipTriangleWinding; + } virtual void getAabb(const btTransform& t, btVector3& aabbMin, btVector3& aabbMax) const; virtual void processAllTriangles(btTriangleCallback * callback, const btVector3& aabbMin, const btVector3& aabbMax) const; @@ -166,16 +171,20 @@ public: virtual void setLocalScaling(const btVector3& scaling); virtual const btVector3& getLocalScaling() const; - - void getVertex(int x,int y,btVector3& vertex) const; - void performRaycast (btTriangleCallback* callback, const btVector3& raySource, const btVector3& rayTarget) const; + void getVertex(int x, int y, btVector3& vertex) const; + + void performRaycast(btTriangleCallback * callback, const btVector3& raySource, const btVector3& rayTarget) const; - void buildAccelerator(int chunkSize=16); + void buildAccelerator(int chunkSize = 16); void clearAccelerator(); + int getUpAxis() const + { + return m_upAxis; + } //debugging virtual const char* getName() const { return "HEIGHTFIELD"; } }; -#endif //BT_HEIGHTFIELD_TERRAIN_SHAPE_H +#endif //BT_HEIGHTFIELD_TERRAIN_SHAPE_H
\ No newline at end of file |