Files
o3de/Code/Editor/ViewportManipulatorController.h
T
Roman 55146d037a Add manipulator for atom render plugin in animation editor. (#7068)
* small bugfix

Signed-off-by: rhhong <rhhong@amazon.com>

* ActorInstanceId default to -1 when no %lastresult matches

Signed-off-by: rhhong <rhhong@amazon.com>

* CR feedback - wrap function to get the first available editor actor instance.

Signed-off-by: rhhong <rhhong@amazon.com>

* Remove mcore inline

Signed-off-by: rhhong <rhhong@amazon.com>

* Fixed the bug that delete an instance from actor manager crashes the editor.

Signed-off-by: rhhong <rhhong@amazon.com>

* Move the manipulator controller.

Signed-off-by: rhhong <rhhong@amazon.com>

* Add manipulator icon

Signed-off-by: rhhong <rhhong@amazon.com>

* Add manipulators

Signed-off-by: rhhong <rhhong@amazon.com>

* move more option to renderOption, and loading all going through the plugin

Signed-off-by: rhhong <rhhong@amazon.com>

* code cleanup

Signed-off-by: rhhong <rhhong@amazon.com>

* code cleanup

Signed-off-by: rhhong <rhhong@amazon.com>

* more code cleanup

Signed-off-by: rhhong <rhhong@amazon.com>

* CR FEEDBACK

Signed-off-by: rhhong <rhhong@amazon.com>

* Fix profile_nounity build

Signed-off-by: rhhong <rhhong@amazon.com>

* CR feedback - move more code to azToolsframework and share them between animation editor and editorlib

Signed-off-by: rhhong <rhhong@amazon.com>

* Using the MouseViewportRequests in viewportMessage and remove the custom bus

Signed-off-by: rhhong <rhhong@amazon.com>
2022-01-25 11:25:18 -08:00

51 lines
1.9 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 <AzFramework/Input/Events/InputChannelEventListener.h>
#include <AzFramework/Viewport/MultiViewportController.h>
#include <AzFramework/Viewport/ViewportId.h>
#include <AzToolsFramework/Viewport/ViewportTypes.h>
#include <SandboxAPI.h>
namespace SandboxEditor
{
class ViewportManipulatorControllerInstance;
using ViewportManipulatorController = AzFramework::
MultiViewportController<ViewportManipulatorControllerInstance, AzFramework::ViewportControllerPriority::DispatchToAllPriorities>;
class ViewportManipulatorControllerInstance final
: public AzFramework::MultiViewportControllerInstanceInterface<ViewportManipulatorController>
{
public:
SANDBOX_API ViewportManipulatorControllerInstance(AzFramework::ViewportId viewport, ViewportManipulatorController* controller);
SANDBOX_API ~ViewportManipulatorControllerInstance();
SANDBOX_API bool HandleInputChannelEvent(const AzFramework::ViewportControllerInputEvent& event) override;
SANDBOX_API void ResetInputChannels() override;
SANDBOX_API void UpdateViewport(const AzFramework::ViewportControllerUpdateEvent& event) override;
private:
bool IsDoubleClick(AzToolsFramework::ViewportInteraction::MouseButton) const;
//! Represents the time and location of a click.
struct ClickEvent
{
AZ::ScriptTimePoint m_time;
AzFramework::ScreenPoint m_position;
};
AzToolsFramework::ViewportInteraction::MouseInteraction m_mouseInteraction;
AZStd::unordered_map<AzToolsFramework::ViewportInteraction::MouseButton, ClickEvent> m_pendingDoubleClicks;
AZ::ScriptTimePoint m_currentTime;
};
} // namespace SandboxEditor