InControl API Reference
InputRange Struct Reference

This type represents a range inclusive of two values, and can remap a value from one range to another. More...

Public Member Functions

 InputRange (float value0, float value1, InputRangeType type)
 
 InputRange (InputRangeType type)
 Initializes a new range from a predefined type. More...
 
bool Includes (float value)
 Check whether a value falls within of this range. More...
 
bool Excludes (float value)
 Check whether a value falls outside of this range. More...
 

Static Public Member Functions

static bool Excludes (InputRangeType rangeType, float value)
 Check whether a value falls outside of a specified range. More...
 
static float Remap (float value, InputRange sourceRange, InputRange targetRange)
 Remap the specified value, from one range to another. More...
 
static float Remap (float value, InputRangeType sourceRangeType, InputRangeType targetRangeType)
 Remap the specified value, from one range to another. More...
 

Public Attributes

readonly float Value0
 The first value in the range. More...
 
readonly float Value1
 The second value in the range. More...
 
readonly InputRangeType Type
 An enum type of the range. More...
 

Static Public Attributes

static readonly InputRange None = new InputRange( 0.0f, 0.0f, InputRangeType.None )
 
static readonly InputRange MinusOneToOne = new InputRange( -1.0f, 1.0f, InputRangeType.MinusOneToOne )
 
static readonly InputRange OneToMinusOne = new InputRange( 1.0f, -1.0f, InputRangeType.OneToMinusOne )
 
static readonly InputRange ZeroToOne = new InputRange( 0.0f, 1.0f, InputRangeType.ZeroToOne )
 
static readonly InputRange ZeroToMinusOne = new InputRange( 0.0f, -1.0f, InputRangeType.ZeroToMinusOne )
 
static readonly InputRange OneToZero = new InputRange( 1.0f, 0.0f, InputRangeType.OneToZero )
 
static readonly InputRange MinusOneToZero = new InputRange( -1.0f, 0.0f, InputRangeType.MinusOneToZero )
 
static readonly InputRange[] typeToRange
 

Detailed Description

This type represents a range inclusive of two values, and can remap a value from one range to another.

Constructor & Destructor Documentation

◆ InputRange()

InputRange ( InputRangeType  type)

Initializes a new range from a predefined type.

Member Function Documentation

◆ Excludes() [1/2]

bool Excludes ( float  value)

Check whether a value falls outside of this range.

Returns
true, if the value falls outside this range, false otherwise.
Parameters
valueThe value to check.

◆ Excludes() [2/2]

static bool Excludes ( InputRangeType  rangeType,
float  value 
)
static

Check whether a value falls outside of a specified range.

Returns
true, if the value falls outside this range, false otherwise.
Parameters
rangeTypeThe range to check against.
valueThe value to check.

◆ Includes()

bool Includes ( float  value)

Check whether a value falls within of this range.

Returns
true, if the value falls within this range, false otherwise.
Parameters
valueThe value to check.

◆ Remap() [1/2]

static float Remap ( float  value,
InputRange  sourceRange,
InputRange  targetRange 
)
static

Remap the specified value, from one range to another.

Parameters
valueThe value to remap.
sourceRangeThe source range to map from.
targetRangeThe target range to map to.

◆ Remap() [2/2]

static float Remap ( float  value,
InputRangeType  sourceRangeType,
InputRangeType  targetRangeType 
)
static

Remap the specified value, from one range to another.

Parameters
valueThe value to remap.
sourceRangeTypeThe source range to map from.
targetRangeTypeThe target range to map to.

Member Data Documentation

◆ Type

readonly InputRangeType Type

An enum type of the range.

◆ typeToRange

readonly InputRange [] typeToRange
static
Initial value:
=
{
None,
MinusOneToOne,
OneToMinusOne,
ZeroToOne,
ZeroToMinusOne,
OneToZero,
MinusOneToZero,
}

◆ Value0

readonly float Value0

The first value in the range.

◆ Value1

readonly float Value1

The second value in the range.


The documentation for this struct was generated from the following file: