diff options
author | PouleyKetchoupp <pouleyketchoup@gmail.com> | 2021-05-13 18:08:27 -0700 |
---|---|---|
committer | PouleyKetchoupp <pouleyketchoup@gmail.com> | 2021-05-13 18:08:27 -0700 |
commit | 2045f04f3c807c0760433c9e4b3d4fb5092ecce7 (patch) | |
tree | b3fb37d4656a74cd0dab886d5fd2d02b45530196 | |
parent | 0e124cb2f103c40de4afac6c100b7e8e1f5d9e15 (diff) | |
download | bullet3-2045f04f3c807c0760433c9e4b3d4fb5092ecce7.tar.gz |
Fix early exit in heightfield raycast
When deciding the ray is too short to use the accelerated structure and
a simple raycast is performed, the method now returns to avoid
processing it a second time using the accelerated structure.
-rw-r--r-- | src/BulletCollision/CollisionShapes/btHeightfieldTerrainShape.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/BulletCollision/CollisionShapes/btHeightfieldTerrainShape.cpp b/src/BulletCollision/CollisionShapes/btHeightfieldTerrainShape.cpp index 01bf7f67f..5b1c23d6f 100644 --- a/src/BulletCollision/CollisionShapes/btHeightfieldTerrainShape.cpp +++ b/src/BulletCollision/CollisionShapes/btHeightfieldTerrainShape.cpp @@ -828,6 +828,7 @@ void btHeightfieldTerrainShape::performRaycast(btTriangleCallback* callback, con { // Don't use chunks, the ray is too short in the plane gridRaycast(processTriangles, beginPos, endPos, &indices[0]); + return; } ProcessVBoundsAction processVBounds(m_vboundsGrid, &indices[0]); |