From b99b3783cd7e3fb1bb0a07dc472b2fc000c4cdc1 Mon Sep 17 00:00:00 2001 From: Sheikh Dawood Date: Fri, 25 May 2018 09:54:38 -0500 Subject: PhysX 3.4, APEX 1.4 patch release @24214033 --- PhysX_3.4/Source/PhysX/src/NpShape.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'PhysX_3.4/Source/PhysX/src/NpShape.cpp') diff --git a/PhysX_3.4/Source/PhysX/src/NpShape.cpp b/PhysX_3.4/Source/PhysX/src/NpShape.cpp index 5f595569..5bd5e8ad 100644 --- a/PhysX_3.4/Source/PhysX/src/NpShape.cpp +++ b/PhysX_3.4/Source/PhysX/src/NpShape.cpp @@ -23,7 +23,7 @@ // components in life support devices or systems without express written approval of // NVIDIA Corporation. // -// Copyright (c) 2008-2017 NVIDIA Corporation. All rights reserved. +// Copyright (c) 2008-2018 NVIDIA Corporation. All rights reserved. // Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved. // Copyright (c) 2001-2004 NovodeX AG. All rights reserved. @@ -772,11 +772,11 @@ bool NpShape::checkMaterialSetup(const PxGeometry& geom, const char* errorMsgPre const PxHeightField& mesh = *meshGeom.heightField; if(mesh.getTriangleMaterialIndex(0) != 0xffff) { - const PxU32 nbTris = (mesh.getNbColumns() - 1)*(mesh.getNbColumns() - 1)*2; + const PxU32 nbTris = mesh.getNbColumns()*mesh.getNbRows()*2; for(PxU32 i = 0; i < nbTris; i++) { const PxMaterialTableIndex meshMaterialIndex = mesh.getTriangleMaterialIndex(i); - if(meshMaterialIndex >= materialCount) + if(meshMaterialIndex != PxHeightFieldMaterial::eHOLE && meshMaterialIndex >= materialCount) { Ps::getFoundation().error(PxErrorCode::eINVALID_PARAMETER, __FILE__, __LINE__, "%s: PxHeightField material indices reference more materials than provided!", errorMsgPrefix); -- cgit v1.2.3