![]() |
Open 3D Engine AzFramework API Reference
2205.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
|
#include <InputChannel.h>
Inherits Handler.
Inherited by AzFramework::InputChannelAnalog, AzFramework::InputChannelAxis2D, AzFramework::InputChannelAxis3D, AzFramework::InputChannelDelta, AzFramework::InputChannelDigital, AzFramework::InputChannelQuaternion, and AzFramework::InputMapping.
Classes | |
struct | CustomData |
Base struct from which to derive all custom input data. More... | |
struct | PositionData2D |
Custom data struct for input channels associated with a 2D position. More... | |
struct | Snapshot |
Snapshot of an input channel that can be constructed, copied, and stored independently. More... | |
Public Types | |
enum | State { State::Idle, State::Began, State::Updated, State::Ended } |
State of the input channel (not all channels will go through all states) More... | |
using | SharedPositionData2D = AZStd::shared_ptr< InputChannel::PositionData2D > |
Alias for verbose shared_ptr class. | |
Public Member Functions | |
AZ_CLASS_ALLOCATOR (InputChannel, AZ::SystemAllocator, 0) | |
AZ_RTTI (InputChannel, "{1C88625D-D297-4A1C-AE07-E17F88D138F3}") | |
InputChannel (const InputChannelId &inputChannelId, const InputDevice &inputDevice) | |
AZ_DISABLE_COPY_MOVE (InputChannel) | |
~InputChannel () override | |
Destructor. | |
const InputChannel * | GetInputChannel () const final |
AzFramework::InputChannelRequests::GetInputChannel | |
const InputChannelId & | GetInputChannelId () const |
const InputDevice & | GetInputDevice () const |
State | GetState () const |
bool | IsActive () const |
virtual float | GetValue () const |
virtual float | GetDelta () const |
virtual const CustomData * | GetCustomData () const |
template<class CustomDataType > | |
const CustomDataType * | GetCustomData () const |
bool | UpdateState (bool isChannelActive) |
void | ResetState () override |
AzFramework::InputChannelRequests::ResetState | |
bool | IsStateIdle () const |
bool | IsStateBegan () const |
bool | IsStateUpdated () const |
bool | IsStateEnded () const |
Static Public Member Functions | |
static void | Reflect (AZ::ReflectContext *context) |
Base class for all input channels that represent the current state of a single input source. Derived classes should provide additional functions that allow their parent input devices to update the state and value(s) of the input channel as raw input is received from the system, and they can (optionally) override the virtual GetCustomData function to return custom data.
|
strong |
State of the input channel (not all channels will go through all states)
AzFramework::InputChannel::InputChannel | ( | const InputChannelId & | inputChannelId, |
const InputDevice & | inputDevice | ||
) |
Constructor
[in] | inputChannelId | Id of the input channel |
[in] | inputDevice | Input device that owns the input channel |
|
virtual |
Access to any custom data provided by the input channel
Reimplemented in AzFramework::InputChannelDigitalWithSharedModifierKeyStates, AzFramework::InputChannelAnalogWithPosition2D, AzFramework::InputChannelDigitalWithPosition2D, AzFramework::InputChannelAxis2D, AzFramework::InputChannelAxis3D, AzFramework::InputChannelQuaternion, AzFramework::InputChannelDeltaWithSharedPosition2D, and AzFramework::InputChannelDigitalWithSharedPosition2D.
|
inline |
Access to any custom data of a specific type provided by the input channel
CustomDataType | The specific type of custom data to be returned if it exists |
|
virtual |
Access to the one dimensional float delta of the input channel
Reimplemented in AzFramework::InputMappingAnd, AzFramework::InputMappingOr, AzFramework::InputChannelAxis2D, AzFramework::InputChannelAxis3D, AzFramework::InputChannelQuaternion, AzFramework::InputChannelAnalog, AzFramework::InputChannelDelta, and AzFramework::InputChannelDigital.
const InputChannelId& AzFramework::InputChannel::GetInputChannelId | ( | ) | const |
Access to the input channel's id
const InputDevice& AzFramework::InputChannel::GetInputDevice | ( | ) | const |
Access to the input channel's device
State AzFramework::InputChannel::GetState | ( | ) | const |
Direct access to the input channel's current state
|
virtual |
Access to the one dimensional float value of the input channel
Reimplemented in AzFramework::InputMappingAnd, AzFramework::InputMappingOr, AzFramework::InputChannelAxis2D, AzFramework::InputChannelAxis3D, AzFramework::InputChannelQuaternion, AzFramework::InputChannelAnalog, AzFramework::InputChannelDelta, and AzFramework::InputChannelDigital.
bool AzFramework::InputChannel::IsActive | ( | ) | const |
Indirect access to the input channel's current state
bool AzFramework::InputChannel::IsStateIdle | ( | ) | const |
Indirect access to the input channel's current state
bool AzFramework::InputChannel::UpdateState | ( | bool | isChannelActive | ) |
Update the channel's state based on whether it is active/engaged or inactive/idle, which will broadcast an input event if the channel is left in a non-idle state. Should only be called a maximum of once per channel per frame from InputDeviceRequests::TickInputDevice to ensure input channels broadcast no more than one event each frame (at the same time).
[in] | isChannelActive | Whether the input channel is currently active/engaged |