I made a new C++ driving template project. I’ve been trying to replace the template content with my own.
The template includes UWheeledVehicleMovementComponent4W (wheeledvehiclemovementcomponent4w.cpp -.h) which calls the “PxVehicleDrive4WSmoothAnalogRawInputsAndSetAnalogInputs” in UpdateSimulation() and from the PhysXPublic.h library. I am trying to make my own vehicle movement class which for now is almost identical to the template one’s, except I get this build error:
unresolved external symbol "void __cdecl physx::PxVehicleDrive4WSmoothAnalogRawInputsAndSetAnalogInputs(struct physx::PxVehiclePadSmoothingData const &,class physx::PxFixedSizeLookupTable<8> const &,class physx::PxVehicleDrive4WRawInputData const &,float,bool,class physx::PxVehicleDrive4W &)" (?PxVehicleDrive4WSmoothAnalogRawInputsAndSetAnalogInputs@physx@@YAXAEBUPxVehiclePadSmoothingData@1@AEBV?$PxFixedSizeLookupTable@$07@1@AEBVPxVehicleDrive4WRawInputData@1@M_NAEAVPxVehicleDrive4W@1@@Z) referenced in function "public: void __cdecl ::operator()(struct FPhysicsActorHandle_PhysX const &)const " (??R@@QEBAXAEBUFPhysicsActorHandle_PhysX@@@Z)
#includes are the same and #if WITH_PHYSX… is the same… everything seem to be identical to template code.
If I replace my movement class with the template’s UWheeledVehicleMovementComponent4W everything works fine. I cannot find the definition for “PxVehicleDrive4WSmoothAnalogRawInputsAndSetAnalogInputs” anywhere. I tried looking in engine source and project folders. I should mention that I’m not very familiar with C++.
Where is the physX function “PxVehicleDrive4WSmoothAnalogRawInputsAndSetAnalogInputs” defined?
Why can’t I call it from my movement class?
void UMyVehicleMovement::UpdateSimulation(float DeltaTime)
{
...
PxVehiclePadSmoothingData SmoothData = {
{ ThrottleInputRate.RiseRate, BrakeInputRate.RiseRate, HandbrakeInputRate.RiseRate, SteeringInputRate.RiseRate, SteeringInputRate.RiseRate },
{ ThrottleInputRate.FallRate, BrakeInputRate.FallRate, HandbrakeInputRate.FallRate, SteeringInputRate.FallRate, SteeringInputRate.FallRate }
};
PxVehicleDrive4W* PVehicleDrive4W = (PxVehicleDrive4W*)PVehicleDrive;
PxVehicleDrive4WSmoothAnalogRawInputsAndSetAnalogInputs(SmoothData, SpeedSteerLookup, RawInputData, DeltaTime, false, *PVehicleDrive4W);
});
}