| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
- /*
- * 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/GestureRecognizerClickOrTap.h>
- ////////////////////////////////////////////////////////////////////////////////////////////////////
- namespace Gestures
- {
- ////////////////////////////////////////////////////////////////////////////////////////////////
- //! Input channel that recognizes discrete click or tap gestures.
- class InputChannelGestureClickOrTap : public InputChannelGesture
- , public RecognizerClickOrTap
- {
- 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);
- ////////////////////////////////////////////////////////////////////////////////////////
- // Type Info
- AZ_RTTI(TypeAndConfig, "{A1E1F82E-8418-4B75-A20F-DD34467CF252}", 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(InputChannelGestureClickOrTap, AZ::SystemAllocator);
- ////////////////////////////////////////////////////////////////////////////////////////////
- // Type Info
- AZ_RTTI(InputChannelGestureClickOrTap, "{C9347E72-C4AE-4850-887D-36B002E2D4B2}", 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 InputChannelGestureClickOrTap(const AzFramework::InputChannelId& inputChannelId,
- const AzFramework::InputDevice& inputDevice,
- const Config& config);
- ////////////////////////////////////////////////////////////////////////////////////////////
- // Disable copying
- AZ_DISABLE_COPY_MOVE(InputChannelGestureClickOrTap);
- ////////////////////////////////////////////////////////////////////////////////////////////
- //! Destructor
- ~InputChannelGestureClickOrTap() override;
- protected:
- ////////////////////////////////////////////////////////////////////////////////////////////
- //! \ref AzFramework::InputChannel::GetValue
- float GetValue() const override;
- ////////////////////////////////////////////////////////////////////////////////////////////
- //! \ref AzFramework::InputChannel::GetCustomData
- const InputChannel::CustomData* GetCustomData() const override;
- ////////////////////////////////////////////////////////////////////////////////////////////
- //! \ref Gestures::RecognizerDiscrete::OnDiscreteGestureRecognized
- void OnDiscreteGestureRecognized() override;
- };
- } // namespace Gestures
|