diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2020-01-08 18:05:43 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2020-01-08 18:05:43 +0100 |
commit | 29e07dfa4e42b871ee30e398b1c35d1aea68cd57 (patch) | |
tree | 77cf7199b8f656302f600ac1c98506042924a1e8 /thirdparty/bullet/BulletCollision/CollisionShapes | |
parent | 98222130bfe5ec90c1030c2d1e4554e990c5e0f9 (diff) |
bullet: Sync with upstream 2.89
This allows distro unbundling again for distros that ship Bullet 2.89+.
Diffstat (limited to 'thirdparty/bullet/BulletCollision/CollisionShapes')
4 files changed, 51 insertions, 6 deletions
diff --git a/thirdparty/bullet/BulletCollision/CollisionShapes/btHeightfieldTerrainShape.cpp b/thirdparty/bullet/BulletCollision/CollisionShapes/btHeightfieldTerrainShape.cpp index 34ec2d8c45..34e7926f17 100644 --- a/thirdparty/bullet/BulletCollision/CollisionShapes/btHeightfieldTerrainShape.cpp +++ b/thirdparty/bullet/BulletCollision/CollisionShapes/btHeightfieldTerrainShape.cpp @@ -21,6 +21,9 @@ btHeightfieldTerrainShape::btHeightfieldTerrainShape( int heightStickWidth, int heightStickLength, const void* heightfieldData, btScalar heightScale, btScalar minHeight, btScalar maxHeight, int upAxis, PHY_ScalarType hdt, bool flipQuadEdges) + :m_userIndex2(-1), + m_userValue3(0), + m_triangleInfoMap(0) { initialize(heightStickWidth, heightStickLength, heightfieldData, heightScale, minHeight, maxHeight, upAxis, hdt, @@ -28,6 +31,9 @@ btHeightfieldTerrainShape::btHeightfieldTerrainShape( } btHeightfieldTerrainShape::btHeightfieldTerrainShape(int heightStickWidth, int heightStickLength, const void* heightfieldData, btScalar maxHeight, int upAxis, bool useFloatData, bool flipQuadEdges) + :m_userIndex2(-1), + m_userValue3(0), + m_triangleInfoMap(0) { // legacy constructor: support only float or unsigned char, // and min height is zero @@ -349,12 +355,12 @@ void btHeightfieldTerrainShape::processAllTriangles(btTriangleCallback* callback getVertex(x, j, vertices[indices[0]]); getVertex(x, j + 1, vertices[indices[1]]); getVertex(x + 1, j + 1, vertices[indices[2]]); - callback->processTriangle(vertices, x, j); + callback->processTriangle(vertices, 2 * x, j); //second triangle // getVertex(x,j,vertices[0]);//already got this vertex before, thanks to Danny Chapman getVertex(x + 1, j + 1, vertices[indices[1]]); getVertex(x + 1, j, vertices[indices[2]]); - callback->processTriangle(vertices, x, j); + callback->processTriangle(vertices, 2 * x+1, j); } else { @@ -362,12 +368,12 @@ void btHeightfieldTerrainShape::processAllTriangles(btTriangleCallback* callback getVertex(x, j, vertices[indices[0]]); getVertex(x, j + 1, vertices[indices[1]]); getVertex(x + 1, j, vertices[indices[2]]); - callback->processTriangle(vertices, x, j); + callback->processTriangle(vertices, 2 * x, j); //second triangle getVertex(x + 1, j, vertices[indices[0]]); //getVertex(x,j+1,vertices[1]); getVertex(x + 1, j + 1, vertices[indices[2]]); - callback->processTriangle(vertices, x, j); + callback->processTriangle(vertices, 2 * x+1, j); } } } diff --git a/thirdparty/bullet/BulletCollision/CollisionShapes/btHeightfieldTerrainShape.h b/thirdparty/bullet/BulletCollision/CollisionShapes/btHeightfieldTerrainShape.h index 43e1d25e3d..8dea98fc6b 100644 --- a/thirdparty/bullet/BulletCollision/CollisionShapes/btHeightfieldTerrainShape.h +++ b/thirdparty/bullet/BulletCollision/CollisionShapes/btHeightfieldTerrainShape.h @@ -114,6 +114,11 @@ protected: int m_vboundsGridLength; int m_vboundsChunkSize; + int m_userIndex2; + btScalar m_userValue3; + + struct btTriangleInfoMap* m_triangleInfoMap; + virtual btScalar getRawHeightFieldValue(int x, int y) const; void quantizeWithClamp(int* out, const btVector3& point, int isMax) const; @@ -185,6 +190,40 @@ public: } //debugging virtual const char* getName() const { return "HEIGHTFIELD"; } + + + void setUserIndex2(int index) + { + m_userIndex2 = index; + } + int getUserIndex2() const + { + return m_userIndex2; + } + void setUserValue3(btScalar value) + { + m_userValue3 = value; + } + btScalar getUserValue3() const + { + return m_userValue3; + } + const struct btTriangleInfoMap* getTriangleInfoMap() const + { + return m_triangleInfoMap; + } + struct btTriangleInfoMap* getTriangleInfoMap() + { + return m_triangleInfoMap; + } + void setTriangleInfoMap(btTriangleInfoMap* map) + { + m_triangleInfoMap = map; + } + const unsigned char* getHeightfieldRawData() const + { + return m_heightfieldDataUnsignedChar; + } }; #endif //BT_HEIGHTFIELD_TERRAIN_SHAPE_H
\ No newline at end of file diff --git a/thirdparty/bullet/BulletCollision/CollisionShapes/btStridingMeshInterface.h b/thirdparty/bullet/BulletCollision/CollisionShapes/btStridingMeshInterface.h index 7d729ee0d7..68a41dfb45 100644 --- a/thirdparty/bullet/BulletCollision/CollisionShapes/btStridingMeshInterface.h +++ b/thirdparty/bullet/BulletCollision/CollisionShapes/btStridingMeshInterface.h @@ -58,7 +58,7 @@ public: virtual void unLockReadOnlyVertexBase(int subpart) const = 0; - /// getNumSubParts returns the number of seperate subparts + /// getNumSubParts returns the number of separate subparts /// each subpart has a continuous array of vertices and indices virtual int getNumSubParts() const = 0; diff --git a/thirdparty/bullet/BulletCollision/CollisionShapes/btTriangleIndexVertexArray.h b/thirdparty/bullet/BulletCollision/CollisionShapes/btTriangleIndexVertexArray.h index 8ebb22baae..556aa3fef4 100644 --- a/thirdparty/bullet/BulletCollision/CollisionShapes/btTriangleIndexVertexArray.h +++ b/thirdparty/bullet/BulletCollision/CollisionShapes/btTriangleIndexVertexArray.h @@ -100,7 +100,7 @@ public: virtual void unLockReadOnlyVertexBase(int subpart) const { (void)subpart; } - /// getNumSubParts returns the number of seperate subparts + /// getNumSubParts returns the number of separate subparts /// each subpart has a continuous array of vertices and indices virtual int getNumSubParts() const { |