MCPcopy Create free account
hub / github.com/NVIDIAGameWorks/PhysX / onSubstep

Method onSubstep

physx/samples/samplevehicle/SampleVehicle.cpp:720–839  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

718}
719
720void SampleVehicle::onSubstep(PxF32 dtime)
721{
722 //Update the vehicle controls.
723 switch(mPlayerVehicleType)
724 {
725 case ePLAYER_VEHICLE_TYPE_VEHICLE4W:
726 case ePLAYER_VEHICLE_TYPE_VEHICLE6W:
727 mVehicleController.setCarKeyboardInputs(
728 mControlInputs.getAccelKeyPressed(),
729 mControlInputs.getBrakeKeyPressed(),
730 mControlInputs.getHandbrakeKeyPressed(),
731 mControlInputs.getSteerLeftKeyPressed(),
732 mControlInputs.getSteerRightKeyPressed(),
733 mControlInputs.getGearUpKeyPressed(),
734 mControlInputs.getGearDownKeyPressed());
735 mVehicleController.setCarGamepadInputs(
736 mControlInputs.getAccel(),
737 mControlInputs.getBrake(),
738 mControlInputs.getSteer(),
739 mControlInputs.getGearUp(),
740 mControlInputs.getGearDown(),
741 mControlInputs.getHandbrake());
742 break;
743 case ePLAYER_VEHICLE_TYPE_TANK4W:
744 case ePLAYER_VEHICLE_TYPE_TANK6W:
745 mVehicleController.setTankKeyboardInputs(
746 mControlInputs.getAccelKeyPressed(),
747 mControlInputs.getThrustLeftKeyPressed(),
748 mControlInputs.getThrustRightKeyPressed(),
749 mControlInputs.getBrakeLeftKeyPressed(),
750 mControlInputs.getBrakeRightKeyPressed(),
751 mControlInputs.getGearUpKeyPressed(),
752 mControlInputs.getGearDownKeyPressed());
753 mVehicleController.setTankGamepadInputs(
754 mControlInputs.getAccel(),
755 mControlInputs.getThrustLeft(),
756 mControlInputs.getThrustRight(),
757 mControlInputs.getBrakeLeft(),
758 mControlInputs.getBrakeRight(),
759 mControlInputs.getGearUp(),
760 mControlInputs.getGearDown());
761 break;
762 default:
763 PX_ASSERT(false);
764 break;
765 }
766
767 updateVehicleController(dtime);
768
769 //Update the vehicles.
770 mVehicleManager.suspensionRaycasts(&getActiveScene());
771
772 if (dtime > 0.0f)
773 {
774 PxSceneWriteLock scopedLock(*mScene);
775#if PX_DEBUG_VEHICLE_ON
776 updateVehicleManager(dtime,getActiveScene().getGravity());
777#else

Callers

nothing calls this directly

Calls 15

PxAbsFunction · 0.85
PxAcosFunction · 0.85
computeForwardSpeedMethod · 0.80
PxVec3Class · 0.50
setCarKeyboardInputsMethod · 0.45
getAccelKeyPressedMethod · 0.45
getBrakeKeyPressedMethod · 0.45
getGearUpKeyPressedMethod · 0.45
getGearDownKeyPressedMethod · 0.45

Tested by

no test coverage detected