You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
95 lines
4.5 KiB
C++
95 lines
4.5 KiB
C++
/*
|
|
* Copyright (c) Contributors to the Open 3D Engine Project.
|
|
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
|
*
|
|
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
|
*
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include "InputChannelGesture.h"
|
|
|
|
#include <Gestures/GestureRecognizerDrag.h>
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
namespace Gestures
|
|
{
|
|
////////////////////////////////////////////////////////////////////////////////////////////////
|
|
//! Input channel that recognizes continuous drag gestures.
|
|
class InputChannelGestureDrag : public InputChannelGesture
|
|
, public RecognizerDrag
|
|
{
|
|
public:
|
|
////////////////////////////////////////////////////////////////////////////////////////////
|
|
//! The gesture configuration values that are exposed to the editor.
|
|
struct TypeAndConfig : public Type, public Config
|
|
{
|
|
public:
|
|
////////////////////////////////////////////////////////////////////////////////////////
|
|
// Allocator
|
|
AZ_CLASS_ALLOCATOR(TypeAndConfig, AZ::SystemAllocator, 0);
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////
|
|
// Type Info
|
|
AZ_RTTI(TypeAndConfig, "{E62A1944-F7AC-435E-9EC3-3F0B4BCB93F0}", Type, Config);
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////
|
|
// Reflection
|
|
static void Reflect(AZ::ReflectContext* context);
|
|
|
|
protected:
|
|
////////////////////////////////////////////////////////////////////////////////////////
|
|
//! \ref Gestures::InputChannelGesture::CreateInputChannel
|
|
InputChannelGesture* CreateInputChannel(const AzFramework::InputChannelId& channelId,
|
|
const AzFramework::InputDevice& inputDevice) override;
|
|
};
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////
|
|
// Allocator
|
|
AZ_CLASS_ALLOCATOR(InputChannelGestureDrag, AZ::SystemAllocator, 0);
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////
|
|
// Type Info
|
|
AZ_RTTI(InputChannelGestureDrag, "{A860D040-5931-4232-915E-7B41E747853F}", InputChannel);
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////
|
|
//! Constructor
|
|
//! \param[in] inputChannelId Id of the input channel being constructed
|
|
//! \param[in] inputDevice Input device that owns the input channel
|
|
//! \param[in] config The configuration used to setup the gesture recognizer base class
|
|
explicit InputChannelGestureDrag(const AzFramework::InputChannelId& inputChannelId,
|
|
const AzFramework::InputDevice& inputDevice,
|
|
const Config& config);
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////
|
|
// Disable copying
|
|
AZ_DISABLE_COPY_MOVE(InputChannelGestureDrag);
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////
|
|
//! Destructor
|
|
~InputChannelGestureDrag() override;
|
|
|
|
protected:
|
|
////////////////////////////////////////////////////////////////////////////////////////////
|
|
//! \ref AzFramework::InputChannel::GetValue
|
|
float GetValue() const override;
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////
|
|
//! \ref AzFramework::InputChannel::GetCustomData
|
|
const InputChannel::CustomData* GetCustomData() const override;
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////
|
|
//! \ref Gestures::RecognizerContinuous::OnContinuousGestureInitiated
|
|
void OnContinuousGestureInitiated() override;
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////
|
|
//! \ref Gestures::RecognizerContinuous::OnContinuousGestureUpdated
|
|
void OnContinuousGestureUpdated() override;
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////
|
|
//! \ref Gestures::RecognizerContinuous::OnContinuousGestureEnded
|
|
void OnContinuousGestureEnded() override;
|
|
};
|
|
} // namespace Gestures
|