Adding PhysX support to plugin?

I am working to add PhysX support to a plugin for Unreal Engine 4.17. When I add the PhysX headers I need (namely PxConvexMeshDesc.h). I get the following compiler errors in PxMath.h and PxWindowsIntrinsic.h.

PxWindowsIntrinsics.h(63): error C2062: type ‘float’ unexpected

PxWindowsIntrinsics.h(63): error C2059: syntax error: ‘constant’

PxWindowsIntrinsics.h(63): error C2059: syntax error: ‘)’

PxWindowsIntrinsics.h(64): error C2143: syntax error: missing ‘;’ before ‘{’

PxWindowsIntrinsics.h(64): error C2447: ‘{’: missing function header (old-style formal list?)

PxMath.h(320): error C2589: ‘(’: illegal token on right side of ‘::’

PxMath.h(320): error C2059: syntax error: ‘::’

ERROR : UBT error : Failed to produce item: C:\Users\Dragonfire\Documents\Unreal Projects\LRMVehicle\Plugins\BMVehicle\Binaries\Win64\UE4Editor-BMVehicle.pdb

Any ideas on what I am doing wrong to include the headers?

Look up how other plugins use PhysX, here you have one:

https://github.com/EpicGames/UnrealEngine/tree/8e4560b8c22b309e73ff0ce90377742c3dfe13cc/Engine/Plugins/Runtime/ImmediatePhysics

Remember to also check build script as you will need to add PhysX module depency

The link goes to a 404. I logged in and it still went 404.

I added PhysX and APEX to the dependencies, first in public then also in private. It appears to be a namespace collision in one of the PhysX math header inline functions.

I will dig through the source code for ImmediatePhysics plugin and see what I can work out. Thank you for the lead on where to look. I hadn’t even considered looking into their internal plugins.