mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-04-01 01:06:42 +00:00
heighfield: buildAccellerator()
This enables accelleration of heightfield collisions. Unfortunately, `btHeightfieldTerrainShape::processAllTriangle` does not yet use the accellerator data, so this change does not improve performance yet but might do so in future bullet versions. References: * Accellerator introduced in: https://github.com/bulletphysics/bullet3/pull/2062 * Feature request to use the accellerator in `processAllTriangle`: https://github.com/bulletphysics/bullet3/issues/3276
This commit is contained in:
parent
92300733c5
commit
21a70b7d2b
1 changed files with 6 additions and 0 deletions
|
@ -58,6 +58,12 @@ namespace MWPhysics
|
||||||
mShape->setUseDiamondSubdivision(true);
|
mShape->setUseDiamondSubdivision(true);
|
||||||
mShape->setLocalScaling(btVector3(triSize, triSize, 1));
|
mShape->setLocalScaling(btVector3(triSize, triSize, 1));
|
||||||
|
|
||||||
|
// Enables acceleration of heighfield collissions.
|
||||||
|
//
|
||||||
|
// Bullet does not yet use this in the most time-consuming method, `btHeightfieldTerrainShape::processAllTriangle`.
|
||||||
|
// See https://github.com/bulletphysics/bullet3/issues/3276
|
||||||
|
mShape->buildAccelerator();
|
||||||
|
|
||||||
btTransform transform(btQuaternion::getIdentity(),
|
btTransform transform(btQuaternion::getIdentity(),
|
||||||
btVector3((x+0.5f) * triSize * (sqrtVerts-1),
|
btVector3((x+0.5f) * triSize * (sqrtVerts-1),
|
||||||
(y+0.5f) * triSize * (sqrtVerts-1),
|
(y+0.5f) * triSize * (sqrtVerts-1),
|
||||||
|
|
Loading…
Reference in a new issue