Click or drag to resize

IVirtualAxis Interface

[This is preliminary documentation and is subject to change.]

Scalar values representing a virtual axis in previous, current and next frame.

Namespace:  RavingBots.MultiInput
Assembly:  RavingBots.MultiInput (in RavingBots.MultiInput.dll) Version: 0.12
Syntax
C#
public interface IVirtualAxis

The IVirtualAxis type exposes the following members.

Properties
  NameDescription
Public propertyCode
Input code associated with this of this axis or None.
Public propertyHasChanged
true if value on this axis has changed from the previous frame.
Public propertyIsDown
true if IsHeld was false in the previous frame but isn't in this one.
Public propertyIsHeld
true if this axis is not in the rest state in the current frame (i.e. Value is not zero).
Public propertyIsUp
true if IsHeld was true in the previous frame and isn't in this one.
Public propertyNextValue
Uncommitted value on this axis for the next frame. May change multiple times during a single frame until committed.
Public propertyPreviousValue
Value on this axis in the previous frame.
Public propertyValue
Value on this axis in the current frame.
Top
Methods
  NameDescription
Public methodAdd
Adds a value to the uncommitted next frame. Convenience method for axes that accumulate input in-between frames.
Public methodCommit
Commits changes to the next frame.
Public methodSet(Boolean)
Sets the next frame value. Convenience method for axes representing digital buttons.
Public methodSet(Single)
Sets the next frame value.
Top
Remarks

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 note 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.
Thread Safety
Static members of this type are not safe for multi-threaded operations. Instance members of this type are not safe for multi-threaded operations.
See Also