From 1fb442e701213fbfec7857ea3eb34749fb6fa1f7 Mon Sep 17 00:00:00 2001 From: Gleb Mazovetskiy Date: Mon, 1 Mar 2021 08:12:43 +0000 Subject: [PATCH] heightfield: Only `buildAccelerator` on Bullet 2.89+ Fixes #5874 --- apps/openmw/mwphysics/heightfield.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/apps/openmw/mwphysics/heightfield.cpp b/apps/openmw/mwphysics/heightfield.cpp index cbcc9d024..34127fe3a 100644 --- a/apps/openmw/mwphysics/heightfield.cpp +++ b/apps/openmw/mwphysics/heightfield.cpp @@ -58,11 +58,14 @@ namespace MWPhysics mShape->setUseDiamondSubdivision(true); mShape->setLocalScaling(btVector3(triSize, triSize, 1)); - // Enables acceleration of heighfield collissions. +#if BT_BULLET_VERSION >= 289 + // Accelerates some collision tests. // - // Bullet does not yet use this in the most time-consuming method, `btHeightfieldTerrainShape::processAllTriangle`. - // See https://github.com/bulletphysics/bullet3/issues/3276 + // Note: The accelerator data structure in Bullet is only used + // in some operations. This could be improved, see: + // https://github.com/bulletphysics/bullet3/issues/3276 mShape->buildAccelerator(); +#endif btTransform transform(btQuaternion::getIdentity(), btVector3((x+0.5f) * triSize * (sqrtVerts-1),