|
|
@@ -1282,7 +1282,7 @@ typedef struct { |
|
|
|
|
|
|
|
#ifdef __cplusplus |
|
|
|
/*! |
|
|
|
* Fix default value within range. |
|
|
|
* Fix the default value within range. |
|
|
|
*/ |
|
|
|
void fixDefault() noexcept |
|
|
|
{ |
|
|
@@ -1294,7 +1294,7 @@ typedef struct { |
|
|
|
*/ |
|
|
|
void fixValue(float& value) const noexcept |
|
|
|
{ |
|
|
|
if (value <= min) |
|
|
|
if (value < min) |
|
|
|
value = min; |
|
|
|
else if (value > max) |
|
|
|
value = max; |
|
|
@@ -1303,7 +1303,7 @@ typedef struct { |
|
|
|
/*! |
|
|
|
* Get a fixed value within range. |
|
|
|
*/ |
|
|
|
float getFixedValue(const float& value) const noexcept |
|
|
|
const float& getFixedValue(const float& value) const noexcept |
|
|
|
{ |
|
|
|
if (value <= min) |
|
|
|
return min; |
|
|
@@ -1351,6 +1351,11 @@ typedef struct { |
|
|
|
*/ |
|
|
|
float getUnnormalizedValue(const float& value) const noexcept |
|
|
|
{ |
|
|
|
if (value <= 0.0f) |
|
|
|
return min; |
|
|
|
if (value >= 1.0f) |
|
|
|
return max; |
|
|
|
|
|
|
|
return value * (max - min) + min; |
|
|
|
} |
|
|
|
#endif /* __cplusplus */ |
|
|
|