Open 3D Engine AzFramework API Reference 25.10.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
AzFramework::InputChannelAnalogWithPosition2D Class Reference

#include <InputChannelAnalogWithPosition2D.h>

Inherits AzFramework::InputChannelAnalog.

Classes

struct  RawInputEvent
 Raw analog with position 2D input event. More...
 

Public Member Functions

 AZ_CLASS_ALLOCATOR (InputChannelAnalogWithPosition2D, AZ::SystemAllocator)
 
 AZ_RTTI (InputChannelAnalogWithPosition2D, "{2C07314B-3294-41F8-9F14-FD5FE4048283}", InputChannel)
 
 InputChannelAnalogWithPosition2D (const InputChannelId &inputChannelId, const InputDevice &inputDevice)
 
 AZ_DISABLE_COPY_MOVE (InputChannelAnalogWithPosition2D)
 
 ~InputChannelAnalogWithPosition2D () override=default
 Default destructor.
 
const InputChannel::CustomDataGetCustomData () const override
 
void ResetState () override
 AzFramework::InputChannelRequests::ResetState
 
void SimulateRawInputWithPosition2D (float rawValue, float normalizedX, float normalizedY) override
 AzFramework::InputChannelRequests::SimulateRawInputWithPosition2D
 
void ProcessRawInputEvent (const RawInputEvent &rawValues)
 
- Public Member Functions inherited from AzFramework::InputChannelAnalog
 AZ_CLASS_ALLOCATOR (InputChannelAnalog, AZ::SystemAllocator)
 
 AZ_RTTI (InputChannelAnalog, "{C3E76C92-0D00-45F1-AF03-EFF3F1910A0D}", InputChannel)
 
 InputChannelAnalog (const InputChannelId &inputChannelId, const InputDevice &inputDevice)
 
 AZ_DISABLE_COPY_MOVE (InputChannelAnalog)
 
 ~InputChannelAnalog () override=default
 Default destructor.
 
float GetValue () const override
 
float GetDelta () const override
 
void ResetState () override
 AzFramework::InputChannelRequests::ResetState
 
void SimulateRawInput (float rawValue) override
 AzFramework::InputChannelRequests::SimulateRawInput
 
void ProcessRawInputEvent (float rawValue)
 
- Public Member Functions inherited from AzFramework::InputChannel
 AZ_CLASS_ALLOCATOR (InputChannel, AZ::SystemAllocator)
 
 AZ_RTTI (InputChannel, "{1C88625D-D297-4A1C-AE07-E17F88D138F3}")
 
 InputChannel (const InputChannelId &inputChannelId, const InputDevice &inputDevice)
 
 AZ_DISABLE_COPY_MOVE (InputChannel)
 
 ~InputChannel () override
 Destructor.
 
const InputChannelGetInputChannel () const final
 AzFramework::InputChannelRequests::GetInputChannel
 
const InputChannelIdGetInputChannelId () const
 
const InputDeviceGetInputDevice () const
 
State GetState () const
 
bool IsActive () 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
 

Additional Inherited Members

- Public Types inherited from AzFramework::InputChannel
enum class  State { Idle , Began , Updated , 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.
 
- Static Public Member Functions inherited from AzFramework::InputChannel
static void Reflect (AZ::ReflectContext *context)
 

Detailed Description

Class for input channels that emit one dimensional analog input values and a position. Example: touch with pressure and position

Constructor & Destructor Documentation

◆ InputChannelAnalogWithPosition2D()

AzFramework::InputChannelAnalogWithPosition2D::InputChannelAnalogWithPosition2D ( const InputChannelId inputChannelId,
const InputDevice inputDevice 
)
explicit

Constructor

Parameters
[in]inputChannelIdId of the input channel being constructed
[in]inputDeviceInput device that owns the input channel

Member Function Documentation

◆ GetCustomData()

const InputChannel::CustomData * AzFramework::InputChannelAnalogWithPosition2D::GetCustomData ( ) const
overridevirtual

Access to the position data associated with the input channel

Returns
Pointer to the position data

Reimplemented from AzFramework::InputChannel.

◆ ProcessRawInputEvent()

void AzFramework::InputChannelAnalogWithPosition2D::ProcessRawInputEvent ( const RawInputEvent rawValues)

Process a raw input event, that will in turn update the channel's state based on whether it's active/engaged or inactive/idle, broadcasting an input event if the channel is left in a non-idle state. This function (or InputChannel::UpdateState) should only be called a max of once per channel per frame from InputDeviceRequests::TickInputDevice to ensure that input channels broadcast no more than one event each frame (and at the same time).

Note that this function hides InputChannelAnalog::ProcessRawInputEvent which is intended.

Parameters
[in]rawValuesThe raw analog value and position 2D to process

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