mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-24 17:13:54 +00:00
exposes getters for typevalidators.
example usage
FRangeValidator gravCoefFValidator(-10.f, 10.f);
addFieldV( "gravityCoefficient", TYPEID< F32 >(), Offset(gravityCoefficient, ParticleData), &gravCoefFValidator,
"Strength of gravity on the particles." ); <- clamps gravity within a -10 to 10 range when evaluating scriptt-set changes
mClamp(gravityCoefficient,gravCoefFValidator.getMin(),gravCoefFValidator.getMax()) for any calculations done on the source side would do the same at the point that is called, with a singularl lookup spot for the range.
This commit is contained in:
parent
463cd50d0a
commit
1a89d95919
1 changed files with 5 additions and 0 deletions
|
|
@ -53,6 +53,8 @@ public:
|
|||
maxV = maxValue;
|
||||
}
|
||||
void validateType(SimObject *object, void *typePtr);
|
||||
F32 getMin() { return minV; };
|
||||
F32 getMax() { return maxV; };
|
||||
};
|
||||
|
||||
/// Signed integer min/max range validator
|
||||
|
|
@ -66,6 +68,8 @@ public:
|
|||
maxV = maxValue;
|
||||
}
|
||||
void validateType(SimObject *object, void *typePtr);
|
||||
F32 getMin() { return minV; };
|
||||
F32 getMax() { return maxV; };
|
||||
};
|
||||
|
||||
/// Scaled integer field validator
|
||||
|
|
@ -93,6 +97,7 @@ class Point3NormalizeValidator : public TypeValidator
|
|||
public:
|
||||
Point3NormalizeValidator(F32 normalizeLength = 1.0f) : length(normalizeLength) { }
|
||||
void validateType(SimObject *object, void *typePtr);
|
||||
F32 getLength() { return length; };
|
||||
};
|
||||
|
||||
namespace CommonValidators
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue