When I try to compile code that uses the ExecuteOnPxRigidDynamicReadWrite lambda, I get the following linker error in the Development Editor configuration:
error LNK2019: unresolved external symbol "class physx::PxScene * __cdecl GetPhysXSceneFromIndex(int)"
Specifically I am trying to implement a class that extends UWheeledVehicleMovementComponent, and I’m using that lambda to call the PxVehicleNoDrive setup function:
ExecuteOnPxRigidDynamicReadWrite(UpdatedPrimitive->GetBodyInstance(), [&](PxRigidDynamic* PRigidDynamic)
{
PVehicleNoDrive->setup(GPhysXSDK, PRigidDynamic, *PWheelsSimData);
PVehicleNoDrive->setToRestState();
// cleanup
PWheelsSimData->free();
});
This code successfully compiles and links on the Development Game configuration. I have PhysX and APEX enabled in PublicDependencyModuleNames for my project as well.
I suspect that the GetPhysXSceneFromIndex function (from Source\Runtime\Engine\Private\PhysicsEngine\PhysXSupport.cpp, line 204) might be undefined in the Editor configurations despite WITH_PHYSX seemingly being defined everywhere else in the code.
Is there anything I might be overlooking?