35#include "vehicle2/drivetrain/PxVehicleDrivetrainParams.h"
36#include "vehicle2/drivetrain/PxVehicleDrivetrainStates.h"
45struct PxVehicleWheelRigidBody1dState;
56PX_FORCE_INLINE PxReal PxVehicleClutchStrengthCompute(
const PxVehicleClutchCommandResponseState& clutchResponseState,
const PxVehicleGearboxParams& gearboxParams,
const PxVehicleGearboxState& gearboxState)
58 return (gearboxParams.neutralGear != gearboxState.currentGear) ? clutchResponseState.commandResponse : 0.0f;
74(
const PxVehicleEngineParams& engineParams,
75 const PxVehicleGearboxParams& gearboxParams,
const PxVehicleGearboxState& gearboxState,
76 const PxVehicleClutchCommandResponseState& clutchResponseState,
77 const PxVehicleEngineDriveThrottleCommandResponseState& throttleResponseState)
79 const PxReal K = (gearboxParams.neutralGear != gearboxState.currentGear) ? clutchResponseState.normalisedCommandResponse : 0.0f;
80 const PxReal zeroThrottleDamping = engineParams.dampingRateZeroThrottleClutchEngaged +
81 (1.0f - K)* (engineParams.dampingRateZeroThrottleClutchDisengaged - engineParams.dampingRateZeroThrottleClutchEngaged);
82 const PxReal appliedThrottle = throttleResponseState.commandResponse;
83 const PxReal fullThrottleDamping = engineParams.dampingRateFullThrottle;
84 const PxReal engineDamping = zeroThrottleDamping + (fullThrottleDamping - zeroThrottleDamping)*appliedThrottle;
95(
const PxVehicleGearboxParams& gearboxParams,
const PxVehicleGearboxState& gearboxState)
97 const PxReal gearRatio = gearboxParams.ratios[gearboxState.currentGear] * gearboxParams.finalRatio;
108(
const PxVehicleEngineParams& engineParams,
const PxVehicleEngineState& engineState,
const PxVehicleEngineDriveThrottleCommandResponseState& throttleCommandResponseState)
110 const PxReal appliedThrottle = throttleCommandResponseState.commandResponse;
111 const PxReal peakTorque = engineParams.peakTorque;
112 const PxVehicleFixedSizeLookupTable<PxReal, PxVehicleEngineParams::eMAX_NB_ENGINE_TORQUE_CURVE_ENTRIES>& torqueCurve = engineParams.torqueCurve;
113 const PxReal normalisedRotSpeed = engineState.rotationSpeed/engineParams.maxOmega;
114 const PxReal engineDriveTorque = appliedThrottle*peakTorque*torqueCurve.interpolate(normalisedRotSpeed);
115 return engineDriveTorque;
130void PX_DEPRECATED PxVehicleLegacyDifferentialWheelSpeedContributionsCompute
131(
const PxVehicleFourWheelDriveDifferentialLegacyParams& diffParams,
132 const PxU32 nbWheels, PxReal* diffAveWheelSpeedContributions);
149void PX_DEPRECATED PxVehicleLegacyDifferentialTorqueRatiosCompute
150(
const PxVehicleFourWheelDriveDifferentialLegacyParams& diffParams,
151 const PxVehicleArrayData<const PxVehicleWheelRigidBody1dState>& wheelOmegas,
152 const PxU32 nbWheels, PxReal* diffTorqueRatios);
#define PX_FORCE_INLINE
Definition PxPreprocessor.h:335
#define PX_DEPRECATED
Definition PxPreprocessor.h:418
Sorts an array of objects in ascending order, assuming that the predicate implements the < operator:
Definition PxBoxController.h:39