From c06d991414b6dc0872ac16e1f7fcc31b2beb6091 Mon Sep 17 00:00:00 2001 From: Maciej Sinilo Date: Wed, 15 Mar 2023 23:10:45 -0400 Subject: [PATCH] Fix for characters auto climbing obstacles higher than their autostep See https://github.com/NVIDIAGameWorks/PhysX/issues/545 for details. --- .../src/CctCharacterController.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/physx/source/physxcharacterkinematic/src/CctCharacterController.cpp b/physx/source/physxcharacterkinematic/src/CctCharacterController.cpp index daf53dd5b..fac23e761 100644 --- a/physx/source/physxcharacterkinematic/src/CctCharacterController.cpp +++ b/physx/source/physxcharacterkinematic/src/CctCharacterController.cpp @@ -66,6 +66,13 @@ static const PxU32 gObstacleDebugColor = PxU32(PxDebugColor::eARGB_CYAN); static const PxU32 gTBVDebugColor = PxU32(PxDebugColor::eARGB_MAGENTA); static const bool gUsePartialUpdates = true; +PX_FORCE_INLINE bool testSideNormal(const PxVec3& normal, const PxVec3& upDirection, PxF32 slopeLimit) +{ + const float dp = normal.dot(upDirection); + return dp originalBottomPoint + PxExtended(stepOffset))