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

@ -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 "