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

@ -67,43 +67,43 @@ void ForestBrushElement::initPersistFields()
addField( "forestItemData", TYPEID< ForestItemData >(), Offset( mData, ForestBrushElement ),
"The type of ForestItem this element holds placement parameters for." );
addField( "probability", TypeF32, Offset( mProbability, ForestBrushElement ),
addFieldV( "probability", TypeRangedF32, Offset( mProbability, ForestBrushElement ), &CommonValidators::PositiveFloat,
"The probability that this element will be created during an editor brush stroke "
"is the sum of all element probabilities in the brush divided by the probability "
"of this element." );
addField( "rotationRange", TypeF32, Offset( mRotationRange, ForestBrushElement ),
addFieldV( "rotationRange", TypeRangedF32, Offset( mRotationRange, ForestBrushElement ), &CommonValidators::PosDegreeRange,
"The max rotation in degrees that items will be placed." );
addField( "scaleMin", TypeF32, Offset( mScaleMin, ForestBrushElement ),
addFieldV( "scaleMin", TypeRangedF32, Offset( mScaleMin, ForestBrushElement ), &CommonValidators::PositiveFloat,
"The minimum random size for each item." );
addField( "scaleMax", TypeF32, Offset( mScaleMax, ForestBrushElement ),
addFieldV( "scaleMax", TypeRangedF32, Offset( mScaleMax, ForestBrushElement ), &CommonValidators::PositiveFloat,
"The maximum random size of each item." );
addField( "scaleExponent", TypeF32, Offset( mScaleExponent, ForestBrushElement ),
addFieldV( "scaleExponent", TypeRangedF32, Offset( mScaleExponent, ForestBrushElement ), &CommonValidators::PositiveFloat,
"An exponent used to bias between the minimum and maximum random sizes." );
addField( "sinkMin", TypeF32, Offset( mSinkMin, ForestBrushElement ),
addFieldV( "sinkMin", TypeRangedF32, Offset( mSinkMin, ForestBrushElement ), &CommonValidators::PositiveFloat,
"Min variation in the sink radius." );
addField( "sinkMax", TypeF32, Offset( mSinkMax, ForestBrushElement ),
addFieldV( "sinkMax", TypeRangedF32, Offset( mSinkMax, ForestBrushElement ), &CommonValidators::PositiveFloat,
"Max variation in the sink radius." );
addField( "sinkRadius", TypeF32, Offset( mSinkRadius, ForestBrushElement ),
addFieldV( "sinkRadius", TypeRangedF32, Offset( mSinkRadius, ForestBrushElement ), &CommonValidators::PositiveFloat,
"This is the radius used to calculate how much to sink the trunk at "
"its base and is used to sink the tree into the ground when its on a slope." );
addField( "slopeMin", TypeF32, Offset( mSlopeMin, ForestBrushElement ),
addFieldV( "slopeMin", TypeRangedF32, Offset( mSlopeMin, ForestBrushElement ), &CommonValidators::PosDegreeRangeQuarter,
"The min surface slope in degrees this item will be placed on." );
addField( "slopeMax", TypeF32, Offset( mSlopeMax, ForestBrushElement ),
addFieldV( "slopeMax", TypeRangedF32, Offset( mSlopeMax, ForestBrushElement ), &CommonValidators::PosDegreeRangeQuarter,
"The max surface slope in degrees this item will be placed on." );
addField( "elevationMin", TypeF32, Offset( mElevationMin, ForestBrushElement ),
addFieldV( "elevationMin", TypeRangedF32, Offset( mElevationMin, ForestBrushElement ), &CommonValidators::F32Range,
"The min world space elevation this item will be placed." );
addField( "elevationMax", TypeF32, Offset( mElevationMax, ForestBrushElement ),
addFieldV( "elevationMax", TypeRangedF32, Offset( mElevationMax, ForestBrushElement ), &CommonValidators::F32Range,
"The max world space elevation this item will be placed." );
endGroup( "ForestBrushElement" );

View file

@ -40,6 +40,7 @@
#include "math/mRandomDeck.h"
#include "math/mRandomSet.h"
#include "scene/sceneContainer.h"
#include "console/typeValidators.h"
bool ForestBrushTool::protectedSetSize( void *object, const char *index, const char *data )
@ -104,6 +105,7 @@ ConsoleDocClass( ForestBrushTool,
"@internal"
);
FRangeValidator fBrushRange(0.0f, 150.0f);
void ForestBrushTool::initPersistFields()
{
docsURL;
@ -111,14 +113,14 @@ void ForestBrushTool::initPersistFields()
addField( "mode", TYPEID< BrushMode >(), Offset( mMode, ForestBrushTool) );
addProtectedField( "size", TypeF32, Offset( mSize, ForestBrushTool ),
&protectedSetSize, &defaultProtectedGetFn, "Brush Size" );
addProtectedFieldV( "size", TypeRangedF32, Offset( mSize, ForestBrushTool ),
&protectedSetSize, &defaultProtectedGetFn, &fBrushRange, "Brush Size" );
addProtectedField( "pressure", TypeF32, Offset( mPressure, ForestBrushTool ),
&protectedSetPressure, &defaultProtectedGetFn, "Brush Pressure" );
addProtectedFieldV( "pressure", TypeRangedF32, Offset( mPressure, ForestBrushTool ),
&protectedSetPressure, &defaultProtectedGetFn, &CommonValidators::NormalizedFloat, "Brush Pressure" );
addProtectedField( "hardness", TypeF32, Offset( mHardness, ForestBrushTool ),
&protectedSetHardness, &defaultProtectedGetFn, "Brush Hardness" );
addProtectedFieldV( "hardness", TypeRangedF32, Offset( mHardness, ForestBrushTool ),
&protectedSetHardness, &defaultProtectedGetFn, &CommonValidators::NormalizedFloat, "Brush Hardness" );
endGroup( "ForestBrushTool" );

View file

@ -108,7 +108,7 @@ void Forest::initPersistFields()
addGroup( "Lod" );
addField( "lodReflectScalar", TypeF32, Offset( mReflectionLodScalar, Forest ),
addFieldV( "lodReflectScalar", TypeRangedF32, Offset( mReflectionLodScalar, Forest ), &CommonValidators::PositiveFloat,
"Scalar applied to the farclip distance when Forest renders into a reflection." );
endGroup( "Lod" );

View file

@ -70,40 +70,40 @@ void ForestItemData::initPersistFields()
addGroup("Physics");
addField( "collidable", TypeBool, Offset( mCollidable, ForestItemData ),
"Can other objects or spacial queries hit items of this type." );
addField( "radius", TypeF32, Offset( mRadius, ForestItemData ),
addFieldV( "radius", TypeRangedF32, Offset( mRadius, ForestItemData ), &CommonValidators::PositiveFloat,
"Radius used during placement to ensure items are not crowded." );
endGroup("Physics");
addGroup( "Wind" );
addField( "mass", TypeF32, Offset( mMass, ForestItemData ),
addFieldV( "mass", TypeRangedF32, Offset( mMass, ForestItemData ), &CommonValidators::PositiveFloat,
"Mass used in calculating spring forces on the trunk. Generally how "
"springy a plant is." );
addField( "rigidity", TypeF32, Offset( mRigidity, ForestItemData ),
addFieldV( "rigidity", TypeRangedF32, Offset( mRigidity, ForestItemData ), &CommonValidators::PositiveFloat,
"Rigidity used in calculating spring forces on the trunk. How much the plant resists the wind force" );
addField( "tightnessCoefficient", TypeF32, Offset( mTightnessCoefficient, ForestItemData ),
addFieldV( "tightnessCoefficient", TypeRangedF32, Offset( mTightnessCoefficient, ForestItemData ), &CommonValidators::PositiveFloat,
"Coefficient used in calculating spring forces on the trunk. "
"How much the plant resists bending." );
addField( "dampingCoefficient", TypeF32, Offset( mDampingCoefficient, ForestItemData ),
addFieldV( "dampingCoefficient", TypeRangedF32, Offset( mDampingCoefficient, ForestItemData ), &CommonValidators::PositiveFloat,
"Coefficient used in calculating spring forces on the trunk. "
"Causes oscillation and forces to decay faster over time." );
addField( "windScale", TypeF32, Offset( mWindScale, ForestItemData ),
addFieldV( "windScale", TypeRangedF32, Offset( mWindScale, ForestItemData ), &CommonValidators::PositiveFloat,
"Overall scale to the effect of wind." );
addField( "trunkBendScale", TypeF32, Offset( mTrunkBendScale, ForestItemData ),
addFieldV( "trunkBendScale", TypeRangedF32, Offset( mTrunkBendScale, ForestItemData ), &CommonValidators::PositiveFloat,
"Overall bend amount of the tree trunk by wind and impacts." );
addField( "branchAmp", TypeF32, Offset( mWindBranchAmp, ForestItemData ),
addFieldV( "branchAmp", TypeRangedF32, Offset( mWindBranchAmp, ForestItemData ), &CommonValidators::PositiveFloat,
"Amplitude of the effect on larger branches." );
addField( "detailAmp", TypeF32, Offset( mWindDetailAmp, ForestItemData ),
addFieldV( "detailAmp", TypeRangedF32, Offset( mWindDetailAmp, ForestItemData ), &CommonValidators::PositiveFloat,
"Amplitude of the winds effect on leafs/fronds." );
addField( "detailFreq", TypeF32, Offset( mWindDetailFreq, ForestItemData ),
addFieldV( "detailFreq", TypeRangedF32, Offset( mWindDetailFreq, ForestItemData ), &CommonValidators::PositiveFloat,
"Frequency (speed) of the effect on leafs/fronds." );
endGroup( "Wind" );

View file

@ -245,15 +245,15 @@ void ForestWindEmitter::initPersistFields()
addGroup( "ForestWind" );
addField( "windEnabled", TypeBool, Offset( mEnabled, ForestWindEmitter ), "Determines if the emitter will be counted in wind calculations." );
addField( "radialEmitter", TypeBool, Offset( mRadialEmitter, ForestWindEmitter ), "Determines if the emitter is a global direction or local radial emitter." );
addField( "strength", TypeF32, Offset( mWindStrength, ForestWindEmitter ), "The strength of the wind force." );
addField( "radius", TypeF32, Offset( mWindRadius, ForestWindEmitter ), "The radius of the emitter for local radial emitters." );
addField( "gustStrength", TypeF32, Offset( mWindGustStrength, ForestWindEmitter ), "The maximum strength of a gust." );
addField( "gustFrequency", TypeF32, Offset( mWindGustFrequency, ForestWindEmitter ), "The frequency of gusting in seconds." );
addField( "gustYawAngle", TypeF32, Offset( mWindGustYawAngle, ForestWindEmitter ), "The amount of degrees the wind direction can drift (both positive and negative)." );
addField( "gustYawFrequency", TypeF32, Offset( mWindGustYawFrequency, ForestWindEmitter ), "The frequency of wind yaw drift, in seconds." );
addField( "gustWobbleStrength", TypeF32, Offset( mWindGustWobbleStrength, ForestWindEmitter ), "The amount of random wobble added to gust and turbulence vectors." );
addField( "turbulenceStrength", TypeF32, Offset( mWindTurbulenceStrength, ForestWindEmitter ), "The strength of gust turbulence." );
addField( "turbulenceFrequency", TypeF32, Offset( mWindTurbulenceFrequency, ForestWindEmitter ), "The frequency of gust turbulence, in seconds." );
addFieldV( "strength", TypeRangedF32, Offset( mWindStrength, ForestWindEmitter ), &CommonValidators::PositiveFloat, "The strength of the wind force." );
addFieldV( "radius", TypeRangedF32, Offset( mWindRadius, ForestWindEmitter ), &CommonValidators::PositiveFloat, "The radius of the emitter for local radial emitters." );
addFieldV( "gustStrength", TypeRangedF32, Offset( mWindGustStrength, ForestWindEmitter ), &CommonValidators::PositiveFloat, "The maximum strength of a gust." );
addFieldV( "gustFrequency", TypeRangedF32, Offset( mWindGustFrequency, ForestWindEmitter ), &CommonValidators::PositiveFloat, "The frequency of gusting in seconds." );
addFieldV( "gustYawAngle", TypeRangedF32, Offset( mWindGustYawAngle, ForestWindEmitter ), &CommonValidators::PosDegreeRange, "The amount of degrees the wind direction can drift (both positive and negative)." );
addFieldV( "gustYawFrequency", TypeRangedF32, Offset( mWindGustYawFrequency, ForestWindEmitter ), &CommonValidators::PositiveFloat, "The frequency of wind yaw drift, in seconds." );
addFieldV( "gustWobbleStrength", TypeRangedF32, Offset( mWindGustWobbleStrength, ForestWindEmitter ), &CommonValidators::PositiveFloat, "The amount of random wobble added to gust and turbulence vectors." );
addFieldV( "turbulenceStrength", TypeRangedF32, Offset( mWindTurbulenceStrength, ForestWindEmitter ), &CommonValidators::PositiveFloat, "The strength of gust turbulence." );
addFieldV( "turbulenceFrequency", TypeRangedF32, Offset( mWindTurbulenceFrequency, ForestWindEmitter ), &CommonValidators::PositiveFloat, "The frequency of gust turbulence, in seconds." );
addField( "hasMount", TypeBool, Offset( mHasMount, ForestWindEmitter ), "Determines if the emitter is mounted to another object." );
endGroup( "ForestWind" );
}