Defines a float in Lumiverse.
More...
#include <LumiverseFloat.h>
|
void | clamp () |
| Ensures that the value of this float is between min and max.
|
|
|
float | m_val |
| the value of this object
|
|
float | m_default |
| Default value for this float.
|
|
float | m_max |
| Maximum value for the float (default 1.0)
|
|
float | m_min |
|
Defines a float in Lumiverse.
This class allows limits to be set on the minimum and maximum values for the variable in question. Overloads for comparison ops and arithmetic ops are located in Lumiverse namespace.
- See also
- Lumiverse
Lumiverse::LumiverseFloat::LumiverseFloat |
( |
float |
val = 0.0f , |
|
|
float |
def = 0.0f , |
|
|
float |
max = 1.0f , |
|
|
float |
min = 0.0f |
|
) |
| |
Constructs a float, default value is 0.
- Parameters
-
val | Initial value |
def | Default value. When reset() is called, val will be set to def . |
max | Maximum allowed value |
min | Minimum allowed value |
- See also
- reset()
Constructs a float with the contents of a different float.
- Parameters
-
other | The other object to copy from |
Lumiverse::LumiverseFloat::LumiverseFloat |
( |
LumiverseType * |
other | ) |
|
Constructs a float by copying from a generic LumiverseType.
If the other object isn't actually a float, this function will initialize with default values.
- Parameters
-
other | The other object to copy from. |
float Lumiverse::LumiverseFloat::asPercent |
( |
| ) |
|
Returns the value of this float as a percentage.
- Returns
- Returns the value:
m_val / (m_max - m_min)
string Lumiverse::LumiverseFloat::asString |
( |
| ) |
|
|
virtual |
float Lumiverse::LumiverseFloat::getDefault |
( |
| ) |
|
|
inline |
Gets the default value for the float.
- Returns
- Default value
float Lumiverse::LumiverseFloat::getMax |
( |
| ) |
|
|
inline |
Get the maximum value.
- Returns
- Maximum value for the float
float Lumiverse::LumiverseFloat::getMin |
( |
| ) |
|
|
inline |
Get the minimum value.
- Returns
- Minimum value for the float
virtual string Lumiverse::LumiverseFloat::getTypeName |
( |
| ) |
|
|
inlinevirtual |
float Lumiverse::LumiverseFloat::getVal |
( |
| ) |
|
|
inline |
Gets the value of the float.
- Returns
- Value of the object
void Lumiverse::LumiverseFloat::setDefault |
( |
float |
val | ) |
|
|
inline |
Set the default value for the float.
- Parameters
-
void Lumiverse::LumiverseFloat::setMax |
( |
float |
val | ) |
|
|
inline |
Set maximum value.
- Parameters
-
void Lumiverse::LumiverseFloat::setMin |
( |
float |
val | ) |
|
|
inline |
Set miniumum value.
- Parameters
-
void Lumiverse::LumiverseFloat::setVal |
( |
float |
val | ) |
|
|
inline |
Sets the value of the float.
- Parameters
-
JSONNode Lumiverse::LumiverseFloat::toJSON |
( |
string |
name | ) |
|
|
virtual |
Converts the type to a JSON object with the specified name.
Required for proper serialiaztion.
Implements Lumiverse::LumiverseType.
float Lumiverse::LumiverseFloat::m_min |
|
private |
Minimum value for the float (default 0.0)
The documentation for this class was generated from the following files: