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::InputDeviceMotion Class Reference

#include <InputDeviceMotion.h>

Inherits AzFramework::InputDevice, and InputMotionSensorRequestBus::Handler.

Classes

struct  Acceleration
 
class  Implementation
 Base class for platform specific implementations of motion input devices. More...
 
struct  MagneticField
 
struct  Orientation
 
struct  RotationRate
 

Public Types

using ImplementationFactory = Implementation *(InputDeviceMotion &)
 Alias for the function type used to create a custom implementation for this input device.
 

Public Member Functions

 AZ_CLASS_ALLOCATOR (InputDeviceMotion, AZ::SystemAllocator)
 
 AZ_RTTI (InputDeviceMotion, "{AB8AC810-1B66-4BDA-B1D1-67DD70043650}", InputDevice)
 
 InputDeviceMotion (const InputDeviceId &inputDeviceId=Id, ImplementationFactory implementationFactory=&Implementation::Create)
 
 AZ_DISABLE_COPY_MOVE (InputDeviceMotion)
 
 ~InputDeviceMotion () override
 Destructor.
 
const InputChannelByIdMap & GetInputChannelsById () const override
 AzFramework::InputDevice::GetInputChannelsById
 
bool IsSupported () const override
 AzFramework::InputDevice::IsSupported
 
bool IsConnected () const override
 AzFramework::InputDevice::IsConnected
 
void TickInputDevice () override
 AzFramework::InputDeviceRequests::TickInputDevice
 
bool GetInputChannelEnabled (const InputChannelId &channelId) override
 AzFramework::InputMotionSensorRequests::GetInputChannelEnabled
 
void SetInputChannelEnabled (const InputChannelId &channelId, bool enabled) override
 AzFramework::InputMotionSensorRequests::SetInputChannelEnabled
 
void OnApplicationSuspended (Event lastEvent) override
 AzFramework::ApplicationLifecycleEvents::OnApplicationSuspended
 
void OnApplicationResumed (Event lastEvent) override
 AzFramework::ApplicationLifecycleEvents::OnApplicationSuspended
 
void SetImplementation (AZStd::unique_ptr< Implementation > impl)
 
- Public Member Functions inherited from AzFramework::InputDevice
 AZ_CLASS_ALLOCATOR (InputDevice, AZ::SystemAllocator)
 
 AZ_RTTI (InputDevice, "{29F9FB6B-15CB-4DB4-9F36-DE7396B82F3D}")
 
 InputDevice (const InputDeviceId &inputDeviceId)
 
 AZ_DISABLE_COPY_MOVE (InputDevice)
 
 ~InputDevice () override
 Destructor.
 
const InputDeviceGetInputDevice () const final
 AzFramework::InputDeviceRequests::GetInputDevice
 
const InputDeviceIdGetInputDeviceId () const
 
virtual LocalUserId GetAssignedLocalUserId () const
 
virtual void PromptLocalUserSignIn () const
 
virtual const InputChannelByIdMap & GetInputChannelsById () const =0
 
virtual bool IsSupported () const =0
 
virtual bool IsConnected () const =0
 

Static Public Member Functions

static bool IsMotionDevice (const InputDeviceId &inputDeviceId)
 
static void Reflect (AZ::ReflectContext *context)
 
- Static Public Member Functions inherited from AzFramework::InputDevice
static void Reflect (AZ::ReflectContext *context)
 

Static Public Attributes

static constexpr InputDeviceId Id {"motion"}
 The id used to identify the primary motion input device.
 

Protected Types

using AccelerationChannelByIdMap = AZStd::unordered_map< InputChannelId, InputChannelAxis3D * >
 
using RotationRateChannelByIdMap = AZStd::unordered_map< InputChannelId, InputChannelAxis3D * >
 
using MagneticFieldChannelByIdMap = AZStd::unordered_map< InputChannelId, InputChannelAxis3D * >
 
using OrientationChannelByIdMap = AZStd::unordered_map< InputChannelId, InputChannelQuaternion * >
 

Protected Attributes

InputChannelByIdMap m_allChannelsById
 All motion channels by id.
 
AccelerationChannelByIdMap m_accelerationChannelsById
 Acceleration channels by id.
 
RotationRateChannelByIdMap m_rotationRateChannelsById
 Rotation rate channels by id.
 
MagneticFieldChannelByIdMap m_magneticFieldChannelsById
 Magnetic field channels by id.
 
OrientationChannelByIdMap m_orientationChannelsById
 Orientation channels by id.
 
InputChannelIdSet m_enabledMotionChannelIds
 Currently enabled channels ids.
 

Additional Inherited Members

- Protected Member Functions inherited from AzFramework::InputDevice
void BroadcastInputChannelEvent (const InputChannel &inputChannel) const
 
void BroadcastInputTextEvent (const AZStd::string &textUTF8) const
 
void BroadcastInputDeviceConnectedEvent () const
 Broadcast an event when the input device connects to the system.
 
void BroadcastInputDeviceDisconnectedEvent () const
 Broadcast an event when the input device disconnects from the system.
 
void ResetInputChannelStates ()
 Reset the state of all this input device's associated input channels.
 

Detailed Description

Defines a generic motion input device including the ids of all its associated input channels. Platform specific implementations are defined as private implementations so that creating an instance of this generic class will work correctly on any platform that support motion input, while providing access to the device name and associated channel ids on any platform through the 'null' implementation (primarily so that the editor can use them to setup input mappings).

Member Typedef Documentation

◆ AccelerationChannelByIdMap

Alias for verbose container class

Constructor & Destructor Documentation

◆ InputDeviceMotion()

AzFramework::InputDeviceMotion::InputDeviceMotion ( const InputDeviceId inputDeviceId = Id,
ImplementationFactory  implementationFactory = &Implementation::Create 
)
explicit

Constructor

Parameters
[in]inputDeviceIdOptional override of the default input device id
[in]implementationFactoryOptional override of the default Implementation::Create

Member Function Documentation

◆ GetInputChannelsById()

const InputChannelByIdMap & AzFramework::InputDeviceMotion::GetInputChannelsById ( ) const
overridevirtual

◆ IsConnected()

bool AzFramework::InputDeviceMotion::IsConnected ( ) const
overridevirtual

◆ IsMotionDevice()

static bool AzFramework::InputDeviceMotion::IsMotionDevice ( const InputDeviceId inputDeviceId)
static

Check whether an input device id identifies a motion device (regardless of index)

Parameters
[in]inputDeviceIdThe input device id to check
Returns
True if the input device id identifies a motion device, false otherwise

◆ IsSupported()

bool AzFramework::InputDeviceMotion::IsSupported ( ) const
overridevirtual

◆ SetImplementation()

void AzFramework::InputDeviceMotion::SetImplementation ( AZStd::unique_ptr< Implementation impl)
inline

Set the implementation of this input device

Parameters
[in]implementationThe new implementation

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