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

#include <InputMappingAnd.h>

Inherits AzFramework::InputMapping.

Classes

class  Config
 The input mapping configuration values that are exposed to the editor. More...
 

Public Member Functions

 AZ_CLASS_ALLOCATOR (InputMappingAnd, AZ::SystemAllocator)
 
 AZ_RTTI (InputMappingAnd, "{9ADDAB97-E786-4BB9-99EE-924EE956E56A}", InputMapping)
 
 InputMappingAnd (const InputChannelId &inputChannelId, const InputContext &inputContext)
 
 AZ_DISABLE_COPY_MOVE (InputMappingAnd)
 
 ~InputMappingAnd () override=default
 Default Destructor.
 
bool AddSourceInput (const InputChannelId &inputSourceId)
 
bool RemoveSourceInput (const InputChannelId &inputSourceId)
 
float GetValue () const override
 
float GetDelta () const override
 
void ResetState () override
 AzFramework::InputChannelRequests::ResetState
 
- Public Member Functions inherited from AzFramework::InputMapping
 AZ_CLASS_ALLOCATOR (InputMapping, AZ::SystemAllocator)
 
 AZ_RTTI (InputMapping, "{37CA842F-F6E4-47CD-947A-C9B82A2A4DA2}", InputChannel)
 
 InputMapping (const InputChannelId &inputChannelId, const InputContext &inputContext)
 
 AZ_DISABLE_COPY_MOVE (InputMapping)
 
 ~InputMapping () override=default
 Default Destructor.
 
bool ProcessPotentialSourceInputEvent (const InputChannel &inputChannel)
 
virtual void OnTick ()
 Tick/update the input mapping.
 
- 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
 
virtual float GetValue () const
 
virtual float GetDelta () const
 
virtual const CustomDataGetCustomData () 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
 

Protected Member Functions

bool IsSourceInput (const InputChannel &inputChannel) override
 AzFramework::InputMapping::IsSourceInput
 
bool OnSourceInputEvent (const InputChannel &inputChannel) override
 AzFramework::InputMapping::OnSourceInputEvent
 
virtual bool IsSourceInput (const InputChannel &inputChannel)=0
 
virtual bool OnSourceInputEvent (const InputChannel &inputChannel)=0
 

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)
 
- Protected Types inherited from AzFramework::InputMapping
using SourceInputChannelIds = AZStd::unordered_set< InputChannelId >
 
using ActiveInputChannelIds = AZStd::unordered_map< InputChannelId, InputDeviceId >
 

Detailed Description

Class that maps multiple different sources to a single output using 'AND' logic. Example: "gamepad_button_L1" AND "gamepad_button_R1" -> "gameplay_strong_attack"

Constructor & Destructor Documentation

◆ InputMappingAnd()

AzFramework::InputMappingAnd::InputMappingAnd ( const InputChannelId inputChannelId,
const InputContext inputContext 
)

Constructor

Parameters
[in]inputChannelIdId of the input mapping
[in]inputContextInput context that owns the input mapping

Member Function Documentation

◆ AddSourceInput()

bool AzFramework::InputMappingAnd::AddSourceInput ( const InputChannelId inputSourceId)

Add an input source to this input mapping

Parameters
[in]inputSourceIdThe id of the input source to add to this input mapping
Returns
True if the input source was added to this input mapping, false otherwise

◆ GetDelta()

float AzFramework::InputMappingAnd::GetDelta ( ) const
overridevirtual

Access to the average delta of the source input channels currently activating this input

Returns
Difference between the current and last reported values of this input mapping

Reimplemented from AzFramework::InputChannel.

◆ GetValue()

float AzFramework::InputMappingAnd::GetValue ( ) const
overridevirtual

Access to the average value of the source input channels currently activating this input

Returns
The value of the source input channels currently activating this input mapping

Reimplemented from AzFramework::InputChannel.

◆ IsSourceInput()

bool AzFramework::InputMappingAnd::IsSourceInput ( const InputChannel inputChannel)
overrideprotectedvirtual

◆ OnSourceInputEvent()

bool AzFramework::InputMappingAnd::OnSourceInputEvent ( const InputChannel inputChannel)
overrideprotectedvirtual

◆ RemoveSourceInput()

bool AzFramework::InputMappingAnd::RemoveSourceInput ( const InputChannelId inputSourceId)

Remove an input source from this input mapping

Parameters
[in]inputSourceIdThe id of the input source to remove from this input mapping
Returns
True if the input source was removed from this input mapping, false otherwise

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