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

Inherits Gestures::RecognizerDiscrete.

Inherited by Gestures::InputChannelGestureSwipe.

Classes

struct  Config
 

Public Member Functions

 AZ_CLASS_ALLOCATOR (RecognizerSwipe, AZ::SystemAllocator)
 
 AZ_RTTI (RecognizerSwipe, "{3030E923-531F-4CE6-BC8E-84238FA47AB9}", RecognizerDiscrete)
 
 RecognizerSwipe (const Config &config=GetDefaultConfig())
 
int32_t GetPriority () const override
 
bool OnPressedEvent (const AZ::Vector2 &screenPosition, uint32_t pointerIndex) override
 
bool OnDownEvent (const AZ::Vector2 &screenPosition, uint32_t pointerIndex) override
 
bool OnReleasedEvent (const AZ::Vector2 &screenPosition, uint32_t pointerIndex) override
 
ConfigGetConfig ()
 
const ConfigGetConfig () const
 
void SetConfig (const Config &config)
 
AZ::Vector2 GetStartPosition () const
 
AZ::Vector2 GetEndPosition () const
 
AZ::Vector2 GetDelta () const
 
AZ::Vector2 GetDirection () const
 
float GetDistance () const
 
float GetDuration () const
 
float GetVelocity () const
 
- Public Member Functions inherited from Gestures::RecognizerDiscrete
 AZ_CLASS_ALLOCATOR (RecognizerDiscrete, AZ::SystemAllocator)
 
 AZ_RTTI (RecognizerDiscrete, "{51258910-62B3-4830-AF7B-9DA3AD3585CC}", IRecognizer)
 
- Public Member Functions inherited from Gestures::IRecognizer
 AZ_CLASS_ALLOCATOR (IRecognizer, AZ::SystemAllocator)
 
 AZ_RTTI (IRecognizer, "{C3E00298-1953-465F-A360-EBC10B62BFE8}", CustomData)
 
void Enable ()
 Enable this gesture recognizer.
 
void Disable ()
 Disable this gesture recognizer.
 
AZ::s32 GetPriority () const override
 AzFramework::InputChannelNotifications::GetPriority
 
void OnInputChannelEvent (const AzFramework::InputChannel &inputChannel, bool &o_hasBeenConsumed) override
 AzFramework::InputChannelNotifications::OnInputChannelEvent
 

Static Public Member Functions

static float GetDefaultMaxSecondsHeld ()
 
static float GetDefaultMinPixelsMoved ()
 
static uint32_t GetDefaultPointerIndex ()
 
static int32_t GetDefaultPriority ()
 
static const ConfigGetDefaultConfig ()
 

Additional Inherited Members

- Protected Member Functions inherited from Gestures::RecognizerDiscrete
virtual void OnDiscreteGestureRecognized ()=0
 Override to be notified when the discrete gesture is recognized.
 
- Protected Member Functions inherited from Gestures::IRecognizer
uint32_t GetGesturePointerIndex (const AzFramework::InputChannel &inputChannel)
 
void UpdateNormalizedPositionAndDeltaFromScreenPosition (const AZ::Vector2 &screenPositionPixels)
 
- Protected Attributes inherited from Gestures::IRecognizer
const uint32_t INVALID_GESTURE_POINTER_INDEX = static_cast<uint32_t>(-1)
 

Member Function Documentation

◆ OnDownEvent()

bool Gestures::RecognizerSwipe::OnDownEvent ( const AZ::Vector2 &  screenPositionPixels,
uint32_t  pointerIndex 
)
inlineoverridevirtual

Override to be notified each frame a mouse button or finger on a touch screen remains pressed, unless the input event was consumed by a higher priority gesture recognizer.

Parameters
[in]screenPositionPixelsThe screen position (in pixels) of the input event.
[in]pointerIndexThe pointer index of the input event.
Returns
True to consume the underlying input event (preventing it from being sent on to other lower-priority gesture recognizers or input listeners), or false otherwise.

Implements Gestures::IRecognizer.

◆ OnPressedEvent()

bool Gestures::RecognizerSwipe::OnPressedEvent ( const AZ::Vector2 &  screenPositionPixels,
uint32_t  pointerIndex 
)
inlineoverridevirtual

Override to be notified when a mouse button or finger on a touch screen is initially pressed, unless the input event was consumed by a higher priority gesture recognizer.

Parameters
[in]screenPositionPixelsThe screen position (in pixels) of the input event.
[in]pointerIndexThe pointer index of the input event.
Returns
True to consume the underlying input event (preventing it from being sent on to other lower-priority gesture recognizers or input listeners), or false otherwise.

Implements Gestures::IRecognizer.

◆ OnReleasedEvent()

bool Gestures::RecognizerSwipe::OnReleasedEvent ( const AZ::Vector2 &  screenPositionPixels,
uint32_t  pointerIndex 
)
inlineoverridevirtual

Override to be notified when a pressed mouse button or finger on a touch screen becomes released, unless the input event was consumed by a higher priority gesture recognizer.

Parameters
[in]screenPositionPixelsThe screen position (in pixels) of the input event.
[in]pointerIndexThe pointer index of the input event.
Returns
True to consume the underlying input event (preventing it from being sent on to other lower-priority gesture recognizers or input listeners), or false otherwise.

Implements Gestures::IRecognizer.


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