Accessing Physx vehicle data

UE4 exposure of inner vehicle data is lacking, to say the least (no lat/lon slip, tire contact normal, suspension jounce etc.). I absolutely need to access the PxVehicle queried data directly and it seems that this is impossible to do. Unreal uses a custom class (PhysXVehicleManager) to store queried data, raycast results etc. but this class is not accesible from game module, or at least I haven’t been able to do so. For example the following code

FPhysXVehicleManager* VehicleManager = GetWorld()->GetPhysicsScene()->GetVehicleManager();
PxWheelQueryResult * WheelsStates = VehicleManager->GetWheelsStates(VehicleMovement);

results in two unresolved external symbol errors (GetVehicleManager and GetWheelsStates). Any help will be very much appreciated, thank you.

Hey Gastel71,

It turns out the class FPhysXVehicleManager is marked as private by the engine. To fix this you will need to add it to the API and some how pull it out from being marked private. I am not entirely sure how to do this but that’s the root issue.

Thanks,
Michael Brune

@Gastel71 Did you found a way to get this working? I’m stuck with the same problem

Has anyone got this solved?

I think the solution is to grab the github source of UE4 and make a few permissions changes.

If you don’t mind edit source code, it would look something like this:
(Engine\Source\Runtime\Engine\Public\PhysicsPublic.h ~ Line: 376):

ENGINE_API FPhysXVehicleManager* GetVehicleManager();

This will expose the method to the API, and than you can use it.