|
VR-Engage
2.2
|
This transform changes the range of input values by mapping them from an input range to an output range using linear interpolation. It's useful for normalizing or scaling values from hardware-specific ranges to standardized ranges.
#include <remapValueTransform.h>
Public Member Functions | |
| DtRemapValueTransform () | |
| virtual | ~DtRemapValueTransform () override |
| virtual void | init (DtInitTable *config) override |
| virtual float | transform (float value) override |
Public Member Functions inherited from makVre::DtValueTransform | |
| DtValueTransform () | |
| virtual | ~DtValueTransform () |
Protected Attributes | |
| float | myInputMin |
| float | myInputMax |
| float | myOutputMin |
| float | myOutputMax |
| float | myInputRange |
| float | myOutputRange |
| makVre::DtRemapValueTransform::DtRemapValueTransform | ( | ) |
Default constructor.
Initializes the remap ranges with default values
|
overridevirtual |
Virtual destructor.
|
overridevirtual |
Initialize the remap transform from configuration.
Reads the input and output range parameters from the configuration table. Expected configuration parameters are:
| config | Pointer to the configuration table |
Implements makVre::DtValueTransform.
|
overridevirtual |
Apply the remapping transformation to an input value.
Linearly remaps the input value from the input range to the output range. Values outside the input range will be clamped to the output range boundaries.
| value | The raw input value to transform |
Implements makVre::DtValueTransform.
|
protected |
Minimum value of the input range.
|
protected |
Maximum value of the input range.
|
protected |
Minimum value of the output range.
|
protected |
Maximum value of the output range.
|
protected |
Size of the input range (InputMax - InputMin)
Pre-calculated for efficiency in the transform function
|
protected |
Size of the output range (OutputMax - OutputMin)
Pre-calculated for efficiency in the transform function