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

@ -179,52 +179,52 @@ void FlyingVehicleData::initPersistFields()
Parent::initPersistFields();
addGroup("Physics");
addField( "rollForce", TypeF32, Offset(rollForce, FlyingVehicleData),
addFieldV( "rollForce", TypeRangedF32, Offset(rollForce, FlyingVehicleData), &CommonValidators::PositiveFloat,
"@brief Damping torque against rolling maneuvers (rotation about the y-axis), "
"proportional to linear velocity.\n\n"
"Acts to adjust roll to a stable position over time as the vehicle moves." );
addField( "rotationalDrag", TypeF32, Offset(rotationalDrag, FlyingVehicleData),
addFieldV( "rotationalDrag", TypeRangedF32, Offset(rotationalDrag, FlyingVehicleData), &CommonValidators::PositiveFloat,
"Rotational drag factor (slows vehicle rotation speed in all axes)." );
addField( "horizontalSurfaceForce", TypeF32, Offset(horizontalSurfaceForce, FlyingVehicleData),
addFieldV( "horizontalSurfaceForce", TypeRangedF32, Offset(horizontalSurfaceForce, FlyingVehicleData), &CommonValidators::PositiveFloat,
"@brief Damping force in the opposite direction to sideways velocity.\n\n"
"Provides \"bite\" into the wind for climbing/diving and turning)." );
addField( "hoverHeight", TypeF32, Offset(hoverHeight, FlyingVehicleData),
addFieldV( "hoverHeight", TypeRangedF32, Offset(hoverHeight, FlyingVehicleData), &CommonValidators::PositiveFloat,
"The vehicle's height off the ground when at rest." );
addField( "createHoverHeight", TypeF32, Offset(createHoverHeight, FlyingVehicleData),
addFieldV( "createHoverHeight", TypeRangedF32, Offset(createHoverHeight, FlyingVehicleData), &CommonValidators::PositiveFloat,
"@brief The vehicle's height off the ground when useCreateHeight is active.\n\n"
"This can help avoid problems with spawning the vehicle." );
endGroup("Physics");
addGroup("Steering");
addField( "maneuveringForce", TypeF32, Offset(maneuveringForce, FlyingVehicleData),
addFieldV( "maneuveringForce", TypeRangedF32, Offset(maneuveringForce, FlyingVehicleData), &CommonValidators::PositiveFloat,
"@brief Maximum X and Y (horizontal plane) maneuvering force.\n\n"
"The actual force applied depends on the current thrust." );
addField( "verticalSurfaceForce", TypeF32, Offset(verticalSurfaceForce, FlyingVehicleData),
addFieldV( "verticalSurfaceForce", TypeRangedF32, Offset(verticalSurfaceForce, FlyingVehicleData), &CommonValidators::PositiveFloat,
"@brief Damping force in the opposite direction to vertical velocity.\n\n"
"Controls side slip; lower numbers give more slide." );
addField( "vertThrustMultiple", TypeF32, Offset(vertThrustMultiple, FlyingVehicleData),
addFieldV( "vertThrustMultiple", TypeRangedF32, Offset(vertThrustMultiple, FlyingVehicleData), &CommonValidators::PositiveFloat,
"Multiplier applied to the jetForce (defined in VehicleData) when thrusting vertically." );
addField( "steeringForce", TypeF32, Offset(steeringForce, FlyingVehicleData),
addFieldV( "steeringForce", TypeRangedF32, Offset(steeringForce, FlyingVehicleData), &CommonValidators::PositiveFloat,
"@brief Maximum X and Z (sideways and vertical) steering force.\n\n"
"The actual force applied depends on the current steering input." );
addField( "steeringRollForce", TypeF32, Offset(steeringRollForce, FlyingVehicleData),
addFieldV( "steeringRollForce", TypeRangedF32, Offset(steeringRollForce, FlyingVehicleData), &CommonValidators::PositiveFloat,
"Roll force induced by sideways steering input value (controls how much "
"the vehicle rolls when turning)." );
endGroup("Steering");
addGroup("AutoCorrection");
addField( "maxAutoSpeed", TypeF32, Offset(maxAutoSpeed, FlyingVehicleData),
addFieldV( "maxAutoSpeed", TypeRangedF32, Offset(maxAutoSpeed, FlyingVehicleData), &CommonValidators::PositiveFloat,
"Maximum speed for automatic vehicle control assistance - vehicles "
"travelling at speeds above this value do not get control assitance." );
addField( "autoInputDamping", TypeF32, Offset(autoInputDamping, FlyingVehicleData),
addFieldV( "autoInputDamping", TypeRangedF32, Offset(autoInputDamping, FlyingVehicleData), &CommonValidators::PositiveFloat,
"@brief Scale factor applied to steering input if speed is less than "
"maxAutoSpeed to.improve handling at very low speeds.\n\n"
"Smaller values make steering less sensitive." );
addField( "autoLinearForce", TypeF32, Offset(autoLinearForce, FlyingVehicleData),
addFieldV( "autoLinearForce", TypeRangedF32, Offset(autoLinearForce, FlyingVehicleData), &CommonValidators::PositiveFloat,
"@brief Corrective force applied to slow the vehicle when moving at less than "
"maxAutoSpeed.\n\n"
"The force is inversely proportional to vehicle speed." );
addField( "autoAngularForce", TypeF32, Offset(autoAngularForce, FlyingVehicleData),
addFieldV( "autoAngularForce", TypeRangedF32, Offset(autoAngularForce, FlyingVehicleData), &CommonValidators::PositiveFloat,
"@brief Corrective torque applied to level out the vehicle when moving at less "
"than maxAutoSpeed.\n\n"
"The torque is inversely proportional to vehicle speed." );
@ -245,7 +245,7 @@ void FlyingVehicleData::initPersistFields()
"and JetNozzle3." );
addField( "trailEmitter",TYPEID< ParticleEmitterData >(), Offset(jetEmitter[TrailEmitter], FlyingVehicleData),
"Emitter to generate contrail particles from model nodes contrail0 - contrail3." );
addField( "minTrailSpeed", TypeF32, Offset(minTrailSpeed, FlyingVehicleData),
addFieldV( "minTrailSpeed", TypeRangedF32, Offset(minTrailSpeed, FlyingVehicleData), &CommonValidators::PositiveFloat,
"Minimum speed at which to start generating contrail particles." );
endGroup("Particle Effects");

View file

@ -111,15 +111,15 @@ void GuiSpeedometerHud::initPersistFields()
docsURL;
addGroup("Needle");
addField("maxSpeed", TypeF32, Offset( mMaxSpeed, GuiSpeedometerHud ),
addFieldV("maxSpeed", TypeRangedF32, Offset( mMaxSpeed, GuiSpeedometerHud ), &CommonValidators::PositiveFloat,
"Maximum Vehicle speed (in Torque units per second) to represent on the "
"speedo (Vehicle speeds greater than this are clamped to maxSpeed)." );
addField("minAngle", TypeF32, Offset( mMinAngle, GuiSpeedometerHud ),
addFieldV("minAngle", TypeRangedF32, Offset( mMinAngle, GuiSpeedometerHud ), &CommonValidators::DegreeRange,
"Angle (in radians) of the needle when the Vehicle speed is 0. An angle "
"of 0 points right, 90 points up etc)." );
addField("maxAngle", TypeF32, Offset( mMaxAngle, GuiSpeedometerHud ),
addFieldV("maxAngle", TypeRangedF32, Offset( mMaxAngle, GuiSpeedometerHud ), &CommonValidators::DegreeRange,
"Angle (in radians) of the needle when the Vehicle speed is >= maxSpeed. "
"An angle of 0 points right, 90 points up etc)." );
@ -130,13 +130,13 @@ void GuiSpeedometerHud::initPersistFields()
"Center of the needle, offset from the GuiSpeedometerHud control top "
"left corner" );
addField("length", TypeF32, Offset( mNeedleLength, GuiSpeedometerHud ),
addFieldV("length", TypeRangedF32, Offset( mNeedleLength, GuiSpeedometerHud ), &CommonValidators::PositiveFloat,
"Length of the needle from center to end" );
addField("width", TypeF32, Offset( mNeedleWidth, GuiSpeedometerHud ),
addFieldV("width", TypeRangedF32, Offset( mNeedleWidth, GuiSpeedometerHud ), &CommonValidators::PositiveFloat,
"Width of the needle" );
addField("tail", TypeF32, Offset( mTailLength, GuiSpeedometerHud ),
addFieldV("tail", TypeRangedF32, Offset( mTailLength, GuiSpeedometerHud ), &CommonValidators::PositiveFloat,
"Length of the needle from center to tail" );
endGroup("Needle");

View file

@ -175,11 +175,11 @@ void HoverVehicleData::initPersistFields()
docsURL;
Parent::initPersistFields();
addGroup("Physics");
addField( "normalForce", TypeF32, Offset(normalForce, HoverVehicleData),
addFieldV( "normalForce", TypeRangedF32, Offset(normalForce, HoverVehicleData), &CommonValidators::PositiveFloat,
"Force generated in the ground normal direction when the vehicle is not "
"floating (within stabalizer length from the ground).\n\n"
"@see stabLenMin" );
addField( "stabLenMin", TypeF32, Offset(stabLenMin, HoverVehicleData),
addFieldV( "stabLenMin", TypeRangedF32, Offset(stabLenMin, HoverVehicleData), &CommonValidators::PositiveFloat,
"Length of the base stabalizer when travelling at minimum speed (0).\n"
"Each tick, the vehicle performs 2 raycasts (from the center back and "
"center front of the vehicle) to check for contact with the ground. The "
@ -188,10 +188,10 @@ void HoverVehicleData::initPersistFields()
"spring and ground normal forces are not applied.\n\n"
"<img src=\"images/hoverVehicle_forces.png\">\n"
"@see stabSpringConstant" );
addField( "stabLenMax", TypeF32, Offset(stabLenMax, HoverVehicleData),
addFieldV( "stabLenMax", TypeRangedF32, Offset(stabLenMax, HoverVehicleData), &CommonValidators::PositiveFloat,
"Length of the base stabalizer when travelling at maximum speed "
"(maxThrustSpeed).\n\n@see stabLenMin\n\n@see mainThrustForce" );
addField("vertFactor", TypeF32, Offset(vertFactor, HoverVehicleData),
addFieldV("vertFactor", TypeRangedF32, Offset(vertFactor, HoverVehicleData), &CommonValidators::PositiveFloat,
"Scalar applied to the vertical portion of the velocity drag acting on "
"the vehicle.\nFor the horizontal (X and Y) components of velocity drag, "
"a factor of 0.25 is applied when the vehicle is floating, and a factor "
@ -199,49 +199,49 @@ void HoverVehicleData::initPersistFields()
"is multiplied by the vehicle's dragForce, as defined above, and the "
"result is subtracted from it's movement force.\n"
"@note The vertFactor must be between 0.0 and 1.0 (inclusive).");
addField("stabSpringConstant", TypeF32, Offset(stabSpringConstant, HoverVehicleData),
addFieldV("stabSpringConstant", TypeRangedF32, Offset(stabSpringConstant, HoverVehicleData), &CommonValidators::PositiveFloat,
"Value used to generate stabalizer spring force. The force generated "
"depends on stabilizer compression, that is how close the vehicle is "
"to the ground proportional to current stabalizer length.\n\n"
"@see stabLenMin");
addField("stabDampingConstant", TypeF32, Offset(stabDampingConstant, HoverVehicleData),
addFieldV("stabDampingConstant", TypeRangedF32, Offset(stabDampingConstant, HoverVehicleData), &CommonValidators::PositiveFloat,
"Damping spring force acting against changes in the stabalizer length.\n\n"
"@see stabLenMin");
endGroup("Physics");
addGroup("Steering");
addField( "steeringForce", TypeF32, Offset(steeringForce, HoverVehicleData),
addFieldV( "steeringForce", TypeRangedF32, Offset(steeringForce, HoverVehicleData), &CommonValidators::PositiveFloat,
"Yaw (rotation about the Z-axis) force applied when steering in the x-axis direction."
"about the vehicle's Z-axis)" );
addField( "rollForce", TypeF32, Offset(rollForce, HoverVehicleData),
addFieldV( "rollForce", TypeRangedF32, Offset(rollForce, HoverVehicleData), &CommonValidators::PositiveFloat,
"Roll (rotation about the Y-axis) force applied when steering in the x-axis direction." );
addField( "pitchForce", TypeF32, Offset(pitchForce, HoverVehicleData),
addFieldV( "pitchForce", TypeRangedF32, Offset(pitchForce, HoverVehicleData), &CommonValidators::PositiveFloat,
"Pitch (rotation about the X-axis) force applied when steering in the y-axis direction." );
addField( "dragForce", TypeF32, Offset(dragForce, HoverVehicleData),
addFieldV( "dragForce", TypeRangedF32, Offset(dragForce, HoverVehicleData), &CommonValidators::PositiveFloat,
"Drag force factor that acts opposite to the vehicle velocity.\nAlso "
"used to determnine the vehicle's maxThrustSpeed.\n@see mainThrustForce" );
addField( "mainThrustForce", TypeF32, Offset(mainThrustForce, HoverVehicleData),
addFieldV( "mainThrustForce", TypeRangedF32, Offset(mainThrustForce, HoverVehicleData), &CommonValidators::PositiveFloat,
"Force generated by thrusting the vehicle forward.\nAlso used to determine "
"the maxThrustSpeed:\n\n"
"@tsexample\n"
"maxThrustSpeed = (mainThrustForce + strafeThrustForce) / dragForce;\n"
"@endtsexample\n" );
addField( "reverseThrustForce", TypeF32, Offset(reverseThrustForce, HoverVehicleData),
addFieldV( "reverseThrustForce", TypeRangedF32, Offset(reverseThrustForce, HoverVehicleData), &CommonValidators::PositiveFloat,
"Force generated by thrusting the vehicle backward." );
addField( "strafeThrustForce", TypeF32, Offset(strafeThrustForce, HoverVehicleData),
addFieldV( "strafeThrustForce", TypeRangedF32, Offset(strafeThrustForce, HoverVehicleData), &CommonValidators::PositiveFloat,
"Force generated by thrusting the vehicle to one side.\nAlso used to "
"determine the vehicle's maxThrustSpeed.\n@see mainThrustForce" );
addField( "turboFactor", TypeF32, Offset(turboFactor, HoverVehicleData),
addFieldV( "turboFactor", TypeRangedF32, Offset(turboFactor, HoverVehicleData), &CommonValidators::PositiveFloat,
"Scale factor applied to the vehicle's thrust force when jetting." );
addField( "floatingThrustFactor", TypeF32, Offset(floatingThrustFactor, HoverVehicleData),
addFieldV( "floatingThrustFactor", TypeRangedF32, Offset(floatingThrustFactor, HoverVehicleData), &CommonValidators::PositiveFloat,
"Scalar applied to the vehicle's thrust force when the vehicle is floating.\n"
"@note The floatingThrustFactor must be between 0.0 and 1.0 (inclusive)." );
endGroup("Steering");
addGroup("AutoCorrection");
addField( "gyroDrag", TypeF32, Offset(gyroDrag, HoverVehicleData),
addFieldV( "gyroDrag", TypeRangedF32, Offset(gyroDrag, HoverVehicleData), &CommonValidators::PositiveFloat,
"Damping torque that acts against the vehicle's current angular momentum." );
addField( "restorativeForce", TypeF32, Offset(restorativeForce, HoverVehicleData),
addFieldV( "restorativeForce", TypeRangedF32, Offset(restorativeForce, HoverVehicleData), &CommonValidators::PositiveFloat,
"Force generated to stabalize the vehicle (return it to neutral pitch/roll) "
"when the vehicle is floating (more than stabalizer length from the "
"ground.\n\n@see stabLenMin" );
@ -258,12 +258,12 @@ void HoverVehicleData::initPersistFields()
"\"X Y Z\" offset from the vehicle's origin from which to generate dust "
"trail particles.\nBy default particles are emitted directly beneath the "
"origin of the vehicle model." );
addField( "triggerTrailHeight", TypeF32, Offset(triggerTrailHeight, HoverVehicleData),
addFieldV( "triggerTrailHeight", TypeRangedF32, Offset(triggerTrailHeight, HoverVehicleData), &CommonValidators::PositiveFloat,
"Maximum height above surface to emit dust trail particles.\nIf the vehicle "
"is less than triggerTrailHeight above a static surface with a material that "
"has 'showDust' set to true, the vehicle will emit particles from the "
"dustTrailEmitter." );
addField( "dustTrailFreqMod", TypeF32, Offset(dustTrailFreqMod, HoverVehicleData),
addFieldV( "dustTrailFreqMod", TypeRangedF32, Offset(dustTrailFreqMod, HoverVehicleData), &CommonValidators::PositiveFloat,
"Number of dust trail particles to generate based on vehicle speed.\nThe "
"vehicle's speed is divided by this value to determine how many particles "
"to generate each frame. Lower values give a more dense trail, higher "

View file

@ -297,12 +297,12 @@ void VehicleData::initPersistFields()
"damageEmitterOffset[1] = \"-0.5 3 1\";\n"
"numDmgEmitterAreas = 2;\n"
"@endtsexample\n" );
addField( "damageLevelTolerance", TypeF32, Offset(damageLevelTolerance, VehicleData), VC_NUM_DAMAGE_LEVELS,
addFieldV( "damageLevelTolerance", TypeRangedF32, Offset(damageLevelTolerance, VehicleData), &CommonValidators::PositiveFloat, VC_NUM_DAMAGE_LEVELS,
"@brief Damage levels (as a percentage of maxDamage) above which to begin "
"emitting particles from the associated damageEmitter.\n\n"
"Levels should be in order of increasing damage.\n\n"
"@see damageEmitterOffset" );
addField( "numDmgEmitterAreas", TypeF32, Offset(numDmgEmitterAreas, VehicleData),
addFieldV( "numDmgEmitterAreas", TypeRangedF32, Offset(numDmgEmitterAreas, VehicleData), &CommonValidators::PositiveFloat,
"Number of damageEmitterOffset values to use for each damageEmitter.\n\n"
"@see damageEmitterOffset" );
endGroup("Particle Effects");
@ -313,33 +313,33 @@ void VehicleData::initPersistFields()
endGroup("Physics");
addGroup("Collision");
addField( "collDamageThresholdVel", TypeF32, Offset(collDamageThresholdVel, VehicleData),
addFieldV( "collDamageThresholdVel", TypeRangedF32, Offset(collDamageThresholdVel, VehicleData), &CommonValidators::PositiveFloat,
"Minimum collision velocity to cause damage to this vehicle.\nCurrently unused." );
addField( "collDamageMultiplier", TypeF32, Offset(collDamageMultiplier, VehicleData),
addFieldV( "collDamageMultiplier", TypeRangedF32, Offset(collDamageMultiplier, VehicleData), &CommonValidators::PositiveFloat,
"@brief Damage to this vehicle after a collision (multiplied by collision "
"velocity).\n\nCurrently unused." );
endGroup("Collision");
addGroup("Steering");
addField( "jetForce", TypeF32, Offset(jetForce, VehicleData),
addFieldV( "jetForce", TypeRangedF32, Offset(jetForce, VehicleData), &CommonValidators::PositiveFloat,
"@brief Additional force applied to the vehicle when it is jetting.\n\n"
"For WheeledVehicles, the force is applied in the forward direction. For "
"FlyingVehicles, the force is applied in the thrust direction." );
addField( "jetEnergyDrain", TypeF32, Offset(jetEnergyDrain, VehicleData),
addFieldV( "jetEnergyDrain", TypeRangedF32, Offset(jetEnergyDrain, VehicleData), &CommonValidators::PositiveFloat,
"@brief Energy amount to drain for each tick the vehicle is jetting.\n\n"
"Once the vehicle's energy level reaches 0, it will no longer be able to jet." );
addField( "minJetEnergy", TypeF32, Offset(minJetEnergy, VehicleData),
addFieldV( "minJetEnergy", TypeRangedF32, Offset(minJetEnergy, VehicleData), &CommonValidators::PositiveFloat,
"Minimum vehicle energy level to begin jetting." );
addField( "maxSteeringAngle", TypeF32, Offset(maxSteeringAngle, VehicleData),
addFieldV( "maxSteeringAngle", TypeRangedF32, Offset(maxSteeringAngle, VehicleData), &CommonValidators::PositiveFloat,
"Maximum yaw (horizontal) and pitch (vertical) steering angle in radians." );
endGroup("Steering");
addGroup("AutoCorrection");
addField( "powerSteering", TypeBool, Offset(powerSteering, VehicleData),
"If true, steering does not auto-centre while the vehicle is being steered by its driver." );
addField( "steeringReturn", TypeF32, Offset(steeringReturn, VehicleData),
addFieldV( "steeringReturn", TypeRangedF32, Offset(steeringReturn, VehicleData), &CommonValidators::PositiveFloat,
"Rate at which the vehicle's steering returns to forwards when it is moving." );
addField( "steeringReturnSpeedScale", TypeF32, Offset(steeringReturnSpeedScale, VehicleData),
addFieldV( "steeringReturnSpeedScale", TypeRangedF32, Offset(steeringReturnSpeedScale, VehicleData), &CommonValidators::PositiveFloat,
"Amount of effect the vehicle's speed has on its rate of steering return." );
endGroup("AutoCorrection");
}

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),