PxVehicleComputeSprungMasses
Defined in include/vehicle2/suspension/PxVehicleSuspensionHelpers.h
-
bool PxVehicleComputeSprungMasses(const PxU32 nbSprungMasses, const PxVec3 *sprungMassCoordinates, const PxReal totalMass, const PxVehicleAxes::Enum gravityDirection, PxReal *sprungMasses)
Compute the sprung masses of the suspension springs given (i) the number of sprung masses, (ii) coordinates of the sprung masses in the rigid body frame, (iii) the center of mass offset of the rigid body, (iv) the total mass of the rigid body, and (v) the direction of gravity.
- Parameters
nbSprungMasses – [in] is the number of sprung masses of the vehicle. This value corresponds to the number of wheels on the vehicle.
sprungMassCoordinates – [in] are the coordinates of the sprung masses in the rigid body frame. The array sprungMassCoordinates must be of length nbSprungMasses or greater.
totalMass – [in] is the total mass of all the sprung masses.
gravityDirection – [in] describes the direction of gravitational acceleration.
sprungMasses – [out] are the masses to set in the associated suspension data with PxVehicleSuspensionData::mSprungMass. The sprungMasses array must be of length nbSprungMasses or greater. Each element in the sprungMasses array corresponds to the suspension located at the same array element in sprungMassCoordinates. The center of mass of the masses in sprungMasses with the coordinates in sprungMassCoordinates satisfy the specified centerOfMass.
- Returns
True if the sprung masses were successfully computed, false if the sprung masses were not successfully computed.