Inherits ScriptObject, and UnitConsumer.
Public Member Functions | |
Range () | |
Range (Number a, Number b, Actuator actuator=Actuator::ACTUATOR_ROTATIONAL) | |
Boolean | isNonRange () |
Number | getMinimum () |
Number | getMaximum () |
Number | getSpan () |
Number | getMiddle () |
grow (Number offset) | |
reduce (Number offset) | |
translate (Number offset) | |
expandTo (Number value) | |
expandToRange (Range value) | |
Number | getU (Number value) |
Boolean | isWithin (Number value) |
Number | clamp (Number value) |
String | toString () |
Public Attributes | |
Number | minimum |
The minimum coordinate of the range. | |
Number | maximum |
The maximum coordinate of the range. | |
Number | span |
The span of the range. | |
Number | middle |
The middle of the range. | |
A 2D range specified by an minimum and maximum value.
Range | ( | ) |
Constructs the range as uninitialized.
Constructs the range from the specified values.
a | Outer value for the range. |
b | Outer value for the range. |
actuator | The actuator type (ie. either "linear" or "rotational"). The default is "rotational". |
expandTo | ( | Number | value | ) |
Expands the range to include the specified value.
expandToRange | ( | Range | value | ) |
Expands the range to include the specified range.
Number getMaximum | ( | ) |
Returns the maximum value.
Number getMiddle | ( | ) |
Returns the middle of the range.
Number getMinimum | ( | ) |
Returns the minimum value.
Number getSpan | ( | ) |
Returns the span of the range.
Returns the U coordinate for the specified value. 0 and 1 corresponds to the minimum and maximum, respectively.
grow | ( | Number | offset | ) |
Grows the range by the specified offset.
Boolean isNonRange | ( | ) |
Returns true if the range is a non-range.
reduce | ( | Number | offset | ) |
Reduces the range by the specified offset. Returns the middle of the range if the range collapses.
String toString | ( | ) |
Converts the range to a string (e.g. [-10.5; 5.75]).
translate | ( | Number | offset | ) |
Translates the range.