IVirtualAxis Interface |
[This is preliminary documentation and is subject to change.]
Namespace: RavingBots.MultiInput
public interface IVirtualAxis
The IVirtualAxis type exposes the following members.
Name | Description | |
---|---|---|
Code |
Input code associated with this of this axis or None.
| |
HasChanged | true if value on this axis has changed from the previous frame.
| |
IsDown | ||
IsHeld | true if this axis is not in the rest state in the current frame
(i.e. Value is not zero).
| |
IsUp | ||
NextValue |
Uncommitted value on this axis for the next frame. May change multiple times
during a single frame until committed.
| |
PreviousValue |
Value on this axis in the previous frame.
| |
Value |
Value on this axis in the current frame.
|
Name | Description | |
---|---|---|
Add |
Adds a value to the uncommitted next frame. Convenience method for axes
that accumulate input in-between frames.
| |
Commit |
Commits changes to the next frame.
| |
Set(Boolean) |
Sets the next frame value. Convenience method for axes representing
digital buttons.
| |
Set(Single) |
Sets the next frame value.
|
This interface is one of the two core abstractions in Multi-Input (the other one being IDevice). All of your input queries will return objects that implement IVirtualAxis.
Virtual axes track their value in a sliding window of previous, current and next frame. Value of the next frame is fetched from platform-specific sources and then committed at the beginning of the frame. Committing replaces previous value with current value, and current value with next value.
All supported inputs (be it digital buttons, analog axes, or completely virtual axes that have no direct physical equivalent) are represented as a scalar floating point value. The exact range depends on the axis in question (for example, buttons will only report discrete 0 or 1, while analog axes will report contiguous values in various ranges, e.g. [0, 1] or [-1, 1]).
Important |
---|
You can (and likely will) create your own virtual axes that aren't attached to any devices (see VirtualAxis). Remember to Commit all the values you Set(Single) on these axes. |