allow Z as up-axis for raycast acceleration in btHeightfieldTerrainShape

This commit is contained in:
erwincoumans
2019-04-16 10:34:59 -07:00
parent 6912290080
commit a8d1c121fd
4 changed files with 81 additions and 44 deletions

View File

@@ -415,8 +415,7 @@ void btCollisionWorld::rayTestSingleInternal(const btTransform& rayFromTrans, co
triangleMesh->performRaycast(&rcb, rayFromLocalScaled, rayToLocalScaled);
}
else if (((resultCallback.m_flags&btTriangleRaycastCallback::kF_DisableHeightfieldAccelerator)==0)
&& collisionShape->getShapeType() == TERRAIN_SHAPE_PROXYTYPE &&
(((btHeightfieldTerrainShape*)collisionShape)->getUpAxis()==1)//accelerator only supports Y axis at the moment
&& collisionShape->getShapeType() == TERRAIN_SHAPE_PROXYTYPE
)
{
///optimized version for btHeightfieldTerrainShape