Addressed feedback from PR 4874. (#4915)

* Addressed feedback from PR 4874.
* Removed second copy of HeightfieldProviderBus.h from cmake file
* Changed CookedMeshShapeConfiguration and HeightfieldShapeConfiguration to have less messy implementations, instead opting for the slightly less messy const_cast inside of Utils.cpp and DebugDraw.cpp.
* Changed InitHeightfieldShapeConfiguraiton to CreateHeightfieldShapeConfiguration with a better API signature.

Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com>

* Fixed indentation

Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com>
This commit is contained in:
Mike Balfour
2021-10-22 14:33:36 -05:00
committed by GitHub
parent 2fe4524458
commit 243532c5de
8 changed files with 54 additions and 28 deletions
+5 -1
View File
@@ -264,7 +264,11 @@ namespace PhysX
case Physics::ShapeType::CookedMesh:
{
const auto& cookedMeshConfig = static_cast<const Physics::CookedMeshShapeConfiguration&>(shapeConfig);
physx::PxBase* meshData = static_cast<physx::PxBase*>(cookedMeshConfig.GetCachedNativeMesh());
const physx::PxBase* constMeshData = static_cast<const physx::PxBase*>(cookedMeshConfig.GetCachedNativeMesh());
// Specifically removing the const from the meshData pointer because the physx APIs expect this pointer to be non-const.
physx::PxBase* meshData = const_cast<physx::PxBase*>(constMeshData);
if (meshData)
{
if (meshData->is<physx::PxTriangleMesh>())