| 718 | } |
| 719 | |
| 720 | void 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 |
nothing calls this directly
no test coverage detected