fill in the validated variables

This commit is contained in:
AzaezelX 2025-03-09 11:53:23 -05:00
parent fa760fa746
commit f633ef3a3d
184 changed files with 1359 additions and 1216 deletions

View file

@ -115,20 +115,20 @@ void WheeledVehicleTire::initPersistFields()
docsURL;
INITPERSISTFIELD_SHAPEASSET(Shape, WheeledVehicleTire, "The shape to use for the wheel.");
addField( "mass", TypeF32, Offset(mass, WheeledVehicleTire),
addFieldV( "mass", TypeRangedF32, Offset(mass, WheeledVehicleTire), &CommonValidators::PositiveFloat,
"The mass of the wheel.\nCurrently unused." );
addField( "radius", TypeF32, Offset(radius, WheeledVehicleTire),
addFieldV( "radius", TypeRangedF32, Offset(radius, WheeledVehicleTire), &CommonValidators::PositiveFloat,
"@brief The radius of the wheel.\n\n"
"The radius is determined from the bounding box of the shape provided "
"in the shapefile field, and does not need to be specified in script. "
"The tire should be built with its hub axis along the object's Y-axis." );
addField( "staticFriction", TypeF32, Offset(staticFriction, WheeledVehicleTire),
addFieldV( "staticFriction", TypeRangedF32, Offset(staticFriction, WheeledVehicleTire), &CommonValidators::PositiveFloat,
"Tire friction when the wheel is not slipping (has traction)." );
addField( "kineticFriction", TypeF32, Offset(kineticFriction, WheeledVehicleTire),
addFieldV( "kineticFriction", TypeRangedF32, Offset(kineticFriction, WheeledVehicleTire), &CommonValidators::PositiveFloat,
"Tire friction when the wheel is slipping (no traction)." );
addField( "restitution", TypeF32, Offset(restitution, WheeledVehicleTire),
addFieldV( "restitution", TypeRangedF32, Offset(restitution, WheeledVehicleTire), &CommonValidators::PositiveFloat,
"Tire restitution.\nCurrently unused." );
addField( "lateralForce", TypeF32, Offset(lateralForce, WheeledVehicleTire),
addFieldV( "lateralForce", TypeRangedF32, Offset(lateralForce, WheeledVehicleTire, &CommonValidators::PositiveFloat), &CommonValidators::PositiveFloat,
"@brief Tire force perpendicular to the direction of movement.\n\n"
"Lateral force can in simple terms be considered left/right steering "
"force. WheeledVehicles are acted upon by forces generated by their tires "
@ -146,14 +146,14 @@ void WheeledVehicleTire::initPersistFields()
"For this field, the larger the value supplied for the lateralForce, the "
"larger the effect steering maneuvers can have. In Torque tire forces are "
"applied at a vehicle's wheel hubs." );
addField( "lateralDamping", TypeF32, Offset(lateralDamping, WheeledVehicleTire),
addFieldV( "lateralDamping", TypeRangedF32, Offset(lateralDamping, WheeledVehicleTire), &CommonValidators::PositiveFloat,
"Damping force applied against lateral forces generated by the tire.\n\n"
"@see lateralForce" );
addField( "lateralRelaxation", TypeF32, Offset(lateralRelaxation, WheeledVehicleTire),
addFieldV( "lateralRelaxation", TypeRangedF32, Offset(lateralRelaxation, WheeledVehicleTire), &CommonValidators::PositiveFloat,
"@brief Relaxing force applied against lateral forces generated by the tire.\n\n"
"The lateralRelaxation force measures how strongly the tire effectively "
"un-deforms.\n\n@see lateralForce" );
addField( "longitudinalForce", TypeF32, Offset(longitudinalForce, WheeledVehicleTire),
addFieldV( "longitudinalForce", TypeRangedF32, Offset(longitudinalForce, WheeledVehicleTire), &CommonValidators::PositiveFloat,
"@brief Tire force in the direction of movement.\n\n"
"Longitudinal force can in simple terms be considered forward/backward "
"movement force. WheeledVehicles are acted upon by forces generated by "
@ -162,10 +162,10 @@ void WheeledVehicleTire::initPersistFields()
"For this field, the larger the value, the larger the effect "
"acceleration/deceleration inputs have.\n\n"
"@see lateralForce" );
addField( "longitudinalDamping", TypeF32, Offset(longitudinalDamping, WheeledVehicleTire),
addFieldV( "longitudinalDamping", TypeRangedF32, Offset(longitudinalDamping, WheeledVehicleTire), &CommonValidators::PositiveFloat,
"Damping force applied against longitudinal forces generated by the tire.\n\n"
"@see longitudinalForce" );
addField( "longitudinalRelaxation", TypeF32, Offset(longitudinalRelaxation, WheeledVehicleTire),
addFieldV( "longitudinalRelaxation", TypeRangedF32, Offset(longitudinalRelaxation, WheeledVehicleTire), &CommonValidators::PositiveFloat,
"@brief Relaxing force applied against longitudinal forces generated by the tire.\n\n"
"The longitudinalRelaxation force measures how strongly the tire effectively "
"un-deforms.\n\n"
@ -235,20 +235,20 @@ WheeledVehicleSpring::WheeledVehicleSpring()
void WheeledVehicleSpring::initPersistFields()
{
docsURL;
addField( "length", TypeF32, Offset(length, WheeledVehicleSpring),
addFieldV( "length", TypeRangedF32, Offset(length, WheeledVehicleSpring), &CommonValidators::PositiveFloat,
"@brief Maximum spring length. ie. how far the wheel can extend from the "
"root hub position.\n\n"
"This should be set to the vertical (Z) distance the hub travels in the "
"associated spring animation." );
addField( "force", TypeF32, Offset(force, WheeledVehicleSpring),
addFieldV( "force", TypeRangedF32, Offset(force, WheeledVehicleSpring), &CommonValidators::PositiveFloat,
"@brief Maximum spring force (when compressed to minimum length, 0).\n\n"
"Increasing this will make the vehicle suspension ride higher (for a given "
"vehicle mass), and also make the vehicle more bouncy when landing jumps." );
addField( "damping", TypeF32, Offset(damping, WheeledVehicleSpring),
addFieldV( "damping", TypeRangedF32, Offset(damping, WheeledVehicleSpring), &CommonValidators::PositiveFloat,
"@brief Force applied to slow changes to the extension of this spring.\n\n"
"Increasing this makes the suspension stiffer which can help stabilise "
"bouncy vehicles." );
addField( "antiSwayForce", TypeF32, Offset(antiSway, WheeledVehicleSpring),
addFieldV( "antiSwayForce", TypeRangedF32, Offset(antiSway, WheeledVehicleSpring), &CommonValidators::PositiveFloat,
"@brief Force applied to equalize extension of the spring on the opposite "
"wheel.\n\n"
"This force helps to keep the suspension balanced when opposite wheels "
@ -465,17 +465,17 @@ void WheeledVehicleData::initPersistFields()
endGroup("Sounds");
addGroup("Steering");
addField("maxWheelSpeed", TypeF32, Offset(maxWheelSpeed, WheeledVehicleData),
addFieldV("maxWheelSpeed", TypeRangedF32, Offset(maxWheelSpeed, WheeledVehicleData), &CommonValidators::PositiveFloat,
"@brief Maximum linear velocity of each wheel.\n\n"
"This caps the maximum speed of the vehicle." );
addField("engineTorque", TypeF32, Offset(engineTorque, WheeledVehicleData),
addFieldV("engineTorque", TypeRangedF32, Offset(engineTorque, WheeledVehicleData), &CommonValidators::PositiveFloat,
"@brief Torque available from the engine at 100% throttle.\n\n"
"This controls vehicle acceleration. ie. how fast it will reach maximum speed." );
addField("engineBrake", TypeF32, Offset(engineBrake, WheeledVehicleData),
addFieldV("engineBrake", TypeRangedF32, Offset(engineBrake, WheeledVehicleData), &CommonValidators::PositiveFloat,
"@brief Braking torque applied by the engine when the throttle and brake "
"are both 0.\n\n"
"This controls how quickly the vehicle will coast to a stop." );
addField("brakeTorque", TypeF32, Offset(brakeTorque, WheeledVehicleData),
addFieldV("brakeTorque", TypeRangedF32, Offset(brakeTorque, WheeledVehicleData), &CommonValidators::PositiveFloat,
"@brief Torque applied when braking.\n\n"
"This controls how fast the vehicle will stop when the brakes are applied." );
addField("downforce", TypeF32, Offset(mDownForce, WheeledVehicleData),