![]() |
Lemmings
Remappable Gestures For Unity
|
Represents a normalized floating-point value and provides tools to remap it across data types. More...
Inherits Lemmings.ILemmingConverter.
Public Member Functions | |
| LemmingFloater (float raw, float min, float max) | |
| Creates a new LemmingFloater with the given raw value, range, and threshold. | |
| int | ToIntRange (int minimum, int maximum) |
| Remaps the normalized value to an integer range. | |
| float | ToFloatRange (float minimum, float maximum) |
| Remaps the normalized value to a floating-point range. | |
| int | ToIndex (int arrayCount) |
| Maps the normalized value to an index in an array of a given size. | |
| float | ToCurve (AnimationCurve curve) |
| Evaluates the normalized value on a Unity AnimationCurve. | |
| Vector3 | ToVector (Vector3 vectorA, Vector3 vectorB) |
| Interpolates between two vectors using the normalized value. | |
| string | ToLabel (string[] labels) |
| Returns a label from a list based on the normalized value. | |
| T | ToEnum< T > () |
| Maps the normalized value to a value in a given enum type. | |
| Quaternion | ToQuaternion (Quaternion a, Quaternion b) |
| Interpolates between two rotations using the normalized value. | |
| Quaternion | ToRotationAroundAxis (Vector3 axis, float minAngle, float maxAngle) |
| Creates a rotation around a given axis by remapping the normalized value to an angle. | |
| Quaternion | ToLookRotation (Vector3 from, Vector3 to) |
| Generates a look rotation from a direction interpolated between two vectors. | |
| T | EvaluateNormalized< T > (Func< float, T > function) |
| Evaluates a custom function against the normalized value and returns the result. | |
| float | Invert () |
| Returns the inverse of the Normalized value. | |
| override string | ToString () |
| Returns a string representation of the floater for debugging. | |
| void | SetRaw (float newRaw) |
| Sets or updates the raw value. | |
| void | SetRange (float newMin, float newMax) |
| Sets the min and max values of the range. | |
| void | Reset (float newRaw, float newMin, float newMax) |
| Resets all internal values at once. | |
Properties | |
| object | Raw [get] |
| float | Normalized [get] |
Returns the normalized value of raw within the range [min, max], clamped between 0 and 1. | |
| bool | Over [get] |
Returns true if raw is greater than or equal to threshold. | |
| bool | InRange [get] |
| Returns true if the raw value is within the specified range. | |
| bool | Under [get] |
Returns true if raw is less than or equal to threshold. | |
| float | AsAxis [get] |
| This provides the normalized value in a range of -1 to 1, useful for input mapping and relative values. | |
Represents a normalized floating-point value and provides tools to remap it across data types.
|
inline |
Creates a new LemmingFloater with the given raw value, range, and threshold.
| raw | The raw input value. |
| min | The minimum input value. |
| max | The maximum input value. |
| threshold | The threshold to compare against. |
| ArgumentException | Thrown if min and max are equal. |
|
inline |
Evaluates a custom function against the normalized value and returns the result.
| T | The return type of the function. |
| function | A function that takes a float (normalized) and returns a value. |
|
inline |
Returns the inverse of the Normalized value.
|
inline |
Resets all internal values at once.
| newRaw | New raw value. |
| newMin | New minimum value. |
| newMax | New maximum value. |
| newThreshold | New threshold value. |
| ArgumentException | Thrown if newMin equals newMax. |
|
inline |
Sets the min and max values of the range.
| newMin | New minimum. |
| newMax | New maximum. |
| ArgumentException | Thrown if newMin equals newMax. |
|
inline |
Sets or updates the raw value.
| newRaw | New raw input. |
|
inline |
Evaluates the normalized value on a Unity AnimationCurve.
| curve | The curve to evaluate. |
Implements Lemmings.ILemmingConverter.
|
inline |
Maps the normalized value to a value in a given enum type.
| T | Enum type to map into. |
| T | : | Enum |
|
inline |
Remaps the normalized value to a floating-point range.
| minimum | Minimum float output value. |
| maximum | Maximum float output value. |
|
inline |
Maps the normalized value to an index in an array of a given size.
| arrayCount | The size of the array. |
|
inline |
Remaps the normalized value to an integer range.
| minimum | Minimum integer output value. |
| maximum | Maximum integer output value. |
|
inline |
Returns a label from a list based on the normalized value.
| labels | Array of labels. |
|
inline |
Generates a look rotation from a direction interpolated between two vectors.
| from | Start direction. |
| to | End direction. |
|
inline |
Interpolates between two rotations using the normalized value.
| a | Start rotation. |
| b | End rotation. |
|
inline |
Creates a rotation around a given axis by remapping the normalized value to an angle.
| axis | Axis to rotate around (must be normalized). |
| minAngle | Minimum angle in degrees. |
| maxAngle | Maximum angle in degrees. |
|
inline |
Interpolates between two vectors using the normalized value.
| vectorA | Start vector. |
| vectorB | End vector. |
|
get |
This provides the normalized value in a range of -1 to 1, useful for input mapping and relative values.
Implements Lemmings.ILemmingConverter.
|
get |
Returns true if the raw value is within the specified range.
Implements Lemmings.ILemmingConverter.
|
get |
Returns the normalized value of raw within the range [min, max], clamped between 0 and 1.
Implements Lemmings.ILemmingConverter.
|
get |
Returns true if raw is greater than or equal to threshold.
Implements Lemmings.ILemmingConverter.
|
get |
Implements Lemmings.ILemmingConverter.
|
get |
Returns true if raw is less than or equal to threshold.
Implements Lemmings.ILemmingConverter.