Merge branch 'main' into LYN-1767-AB
This commit is contained in:
@@ -137,8 +137,20 @@ namespace AzAssetBrowserRequestHandlerPrivate
|
||||
entityName = AZStd::string::format("Entity%d", GetIEditor()->GetObjectManager()->GetObjectCount());
|
||||
}
|
||||
|
||||
AZ::Entity* newEntity = aznew AZ::Entity(entityName.c_str());
|
||||
EditorEntityContextRequestBus::Broadcast(&EditorEntityContextRequests::AddRequiredComponents, *newEntity);
|
||||
AZ::EntityId targetEntityId;
|
||||
EditorRequests::Bus::BroadcastResult(targetEntityId, &EditorRequests::CreateNewEntityAtPosition, worldTransform.GetTranslation(), AZ::EntityId());
|
||||
|
||||
AZ::Entity* newEntity = nullptr;
|
||||
AZ::ComponentApplicationBus::BroadcastResult(newEntity, &AZ::ComponentApplicationRequests::FindEntity, targetEntityId);
|
||||
|
||||
if (newEntity == nullptr)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
newEntity->SetName(entityName);
|
||||
|
||||
newEntity->Deactivate();
|
||||
|
||||
// Create component.
|
||||
AZ::Component* newComponent = newEntity->CreateComponent(componentTypeId);
|
||||
@@ -151,15 +163,7 @@ namespace AzAssetBrowserRequestHandlerPrivate
|
||||
newEntity->AddComponent(newComponent);
|
||||
}
|
||||
|
||||
// Set entity position.
|
||||
auto* transformComponent = newEntity->FindComponent<Components::TransformComponent>();
|
||||
if (transformComponent)
|
||||
{
|
||||
transformComponent->SetWorldTM(worldTransform);
|
||||
}
|
||||
|
||||
// Add the entity to the editor context, which activates it and creates the sandbox object.
|
||||
EditorEntityContextRequestBus::Broadcast(&EditorEntityContextRequests::AddEditorEntity, newEntity);
|
||||
newEntity->Activate();
|
||||
|
||||
// set asset after components have been activated in AddEditorEntity method
|
||||
if (newComponent)
|
||||
|
||||
@@ -129,6 +129,8 @@ ly_add_target(
|
||||
3rdParty::AWSNativeSDK::Core
|
||||
3rdParty::Qt::Network
|
||||
Legacy::EditorCore
|
||||
RUNTIME_DEPENDENCIES
|
||||
Gem::AtomViewportDisplayInfo
|
||||
)
|
||||
ly_add_source_properties(
|
||||
SOURCES CryEdit.cpp
|
||||
@@ -173,6 +175,7 @@ ly_add_target(
|
||||
RUNTIME_DEPENDENCIES
|
||||
Legacy::CrySystem
|
||||
Legacy::EditorLib
|
||||
ProjectManager
|
||||
)
|
||||
ly_add_translations(
|
||||
TARGETS Editor
|
||||
@@ -243,7 +246,8 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED)
|
||||
Legacy::CryCommon
|
||||
AZ::AzToolsFramework
|
||||
Legacy::EditorLib
|
||||
Gem::LmbrCentral
|
||||
RUNTIME_DEPENDENCIES
|
||||
Gem::LmbrCentral
|
||||
)
|
||||
ly_add_googletest(
|
||||
NAME Legacy::EditorLib.Tests
|
||||
|
||||
@@ -421,17 +421,18 @@ QMenu* LevelEditorMenuHandler::CreateFileMenu()
|
||||
fileMenu.AddSeparator();
|
||||
|
||||
// Project Settings
|
||||
auto projectSettingMenu = fileMenu.AddMenu(tr("Project Settings"));
|
||||
fileMenu.AddAction(ID_FILE_PROJECT_MANAGER_SETTINGS);
|
||||
|
||||
// Project Settings Tool
|
||||
// Platform Settings - Project Settings Tool
|
||||
// Shortcut must be set while adding the action otherwise it doesn't work
|
||||
projectSettingMenu.Get()->addAction(
|
||||
fileMenu.Get()->addAction(
|
||||
tr(LyViewPane::ProjectSettingsTool),
|
||||
[]() { QtViewPaneManager::instance()->OpenPane(LyViewPane::ProjectSettingsTool); },
|
||||
tr("Ctrl+Shift+P"));
|
||||
|
||||
projectSettingMenu.AddSeparator();
|
||||
|
||||
fileMenu.AddSeparator();
|
||||
fileMenu.AddAction(ID_FILE_PROJECT_MANAGER_NEW);
|
||||
fileMenu.AddAction(ID_FILE_PROJECT_MANAGER_OPEN);
|
||||
fileMenu.AddSeparator();
|
||||
|
||||
// NEWMENUS: NEEDS IMPLEMENTATION
|
||||
|
||||
@@ -58,6 +58,7 @@ AZ_POP_DISABLE_WARNING
|
||||
#include <AzFramework/Components/CameraBus.h>
|
||||
#include <AzFramework/StringFunc/StringFunc.h>
|
||||
#include <AzFramework/Terrain/TerrainDataRequestBus.h>
|
||||
#include <AzFramework/ProjectManager/ProjectManager.h>
|
||||
|
||||
// AzToolsFramework
|
||||
#include <AzToolsFramework/Component/EditorComponentAPIBus.h>
|
||||
@@ -69,6 +70,7 @@ AZ_POP_DISABLE_WARNING
|
||||
#include <AzToolsFramework/API/EditorPythonConsoleBus.h>
|
||||
#include <AzToolsFramework/API/EditorPythonRunnerRequestsBus.h>
|
||||
#include <AzToolsFramework/API/ToolsApplicationAPI.h>
|
||||
#include <AzToolsFramework/Entity/PrefabEditorEntityOwnershipInterface.h>
|
||||
#include <AzToolsFramework/PythonTerminal/ScriptHelpDialog.h>
|
||||
|
||||
// AzQtComponents
|
||||
@@ -279,6 +281,8 @@ BOOL CCryDocManager::DoPromptFileName(QString& fileName, [[maybe_unused]] UINT n
|
||||
[[maybe_unused]] DWORD lFlags, BOOL bOpenFileDialog, [[maybe_unused]] CDocTemplate* pTemplate)
|
||||
{
|
||||
CLevelFileDialog levelFileDialog(bOpenFileDialog);
|
||||
levelFileDialog.show();
|
||||
levelFileDialog.adjustSize();
|
||||
|
||||
if (levelFileDialog.exec() == QDialog::Accepted)
|
||||
{
|
||||
@@ -476,6 +480,11 @@ void CCryEditApp::RegisterActionHandlers()
|
||||
|
||||
ON_COMMAND(ID_FILE_SAVE_LEVEL, OnFileSave)
|
||||
ON_COMMAND(ID_FILE_EXPORTOCCLUSIONMESH, OnFileExportOcclusionMesh)
|
||||
|
||||
// Project Manager
|
||||
ON_COMMAND(ID_FILE_PROJECT_MANAGER_SETTINGS, OnOpenProjectManagerSettings)
|
||||
ON_COMMAND(ID_FILE_PROJECT_MANAGER_NEW, OnOpenProjectManagerNew)
|
||||
ON_COMMAND(ID_FILE_PROJECT_MANAGER_OPEN, OnOpenProjectManager)
|
||||
}
|
||||
|
||||
CCryEditApp* CCryEditApp::s_currentInstance = nullptr;
|
||||
@@ -2072,6 +2081,8 @@ void CCryEditApp::OnDocumentationAWSSupport()
|
||||
void CCryEditApp::OnDocumentationFeedback()
|
||||
{
|
||||
FeedbackDialog dialog;
|
||||
dialog.show();
|
||||
dialog.adjustSize();
|
||||
dialog.exec();
|
||||
}
|
||||
|
||||
@@ -2853,6 +2864,34 @@ void CCryEditApp::OnPreferences()
|
||||
*/
|
||||
}
|
||||
|
||||
void CCryEditApp::OnOpenProjectManagerSettings()
|
||||
{
|
||||
OpenProjectManager("UpdateProject");
|
||||
}
|
||||
|
||||
void CCryEditApp::OnOpenProjectManagerNew()
|
||||
{
|
||||
OpenProjectManager("CreateProject");
|
||||
}
|
||||
|
||||
void CCryEditApp::OnOpenProjectManager()
|
||||
{
|
||||
OpenProjectManager("Projects");
|
||||
}
|
||||
|
||||
void CCryEditApp::OpenProjectManager(const AZStd::string& screen)
|
||||
{
|
||||
// provide the current project path for in case we want to update the project
|
||||
AZ::IO::FixedMaxPathString projectPath = AZ::Utils::GetProjectPath();
|
||||
const AZStd::string commandLineOptions = AZStd::string::format(" --screen %s --project_path %s", screen.c_str(), projectPath.c_str());
|
||||
bool launchSuccess = AzFramework::ProjectManager::LaunchProjectManager(commandLineOptions);
|
||||
if (!launchSuccess)
|
||||
{
|
||||
QMessageBox::critical(AzToolsFramework::GetActiveWindow(), QObject::tr("Failed to launch O3DE Project Manager"), QObject::tr("Failed to find or start the O3dE Project Manager"));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void CCryEditApp::OnUndo()
|
||||
{
|
||||
@@ -3105,6 +3144,15 @@ CCryEditApp::ECreateLevelResult CCryEditApp::CreateLevel(const QString& levelNam
|
||||
GetIEditor()->GetDocument()->SetPathName(fullyQualifiedLevelName);
|
||||
GetIEditor()->GetGameEngine()->SetLevelPath(levelPath);
|
||||
|
||||
if (usePrefabSystemForLevels)
|
||||
{
|
||||
auto* service = AZ::Interface<AzToolsFramework::PrefabEditorEntityOwnershipInterface>::Get();
|
||||
if (service)
|
||||
{
|
||||
service->CreateNewLevelPrefab(fullyQualifiedLevelName.toUtf8().constData(), DefaultLevelTemplateName);
|
||||
}
|
||||
}
|
||||
|
||||
if (GetIEditor()->GetDocument()->Save())
|
||||
{
|
||||
if (!usePrefabSystemForLevels)
|
||||
@@ -3303,6 +3351,8 @@ void CCryEditApp::OnCreateSlice()
|
||||
void CCryEditApp::OnOpenLevel()
|
||||
{
|
||||
CLevelFileDialog levelFileDialog(true);
|
||||
levelFileDialog.show();
|
||||
levelFileDialog.adjustSize();
|
||||
|
||||
if (levelFileDialog.exec() == QDialog::Accepted)
|
||||
{
|
||||
|
||||
@@ -229,6 +229,9 @@ public:
|
||||
void OnFileResaveSlices();
|
||||
void OnFileEditEditorini();
|
||||
void OnPreferences();
|
||||
void OnOpenProjectManagerSettings();
|
||||
void OnOpenProjectManagerNew();
|
||||
void OnOpenProjectManager();
|
||||
void OnRedo();
|
||||
void OnUpdateRedo(QAction* action);
|
||||
void OnUpdateUndo(QAction* action);
|
||||
@@ -358,12 +361,15 @@ AZ_PUSH_DISABLE_DLL_EXPORT_MEMBER_WARNING
|
||||
AZ_POP_DISABLE_DLL_EXPORT_MEMBER_WARNING
|
||||
|
||||
private:
|
||||
static inline constexpr const char* DefaultLevelTemplateName = "Prefabs/Default_Level.prefab";
|
||||
|
||||
struct PythonOutputHandler;
|
||||
AZ_PUSH_DISABLE_DLL_EXPORT_MEMBER_WARNING
|
||||
AZStd::shared_ptr<PythonOutputHandler> m_pythonOutputHandler;
|
||||
AZ_POP_DISABLE_DLL_EXPORT_MEMBER_WARNING
|
||||
friend struct PythonTestOutputHandler;
|
||||
|
||||
void OpenProjectManager(const AZStd::string& screen);
|
||||
void OnWireframe();
|
||||
void OnUpdateWireframe(QAction* action);
|
||||
void OnViewConfigureLayout();
|
||||
|
||||
@@ -58,13 +58,11 @@
|
||||
#include "LevelFileDialog.h"
|
||||
#include "StatObjBus.h"
|
||||
|
||||
// LmbrCentral
|
||||
#include <ModernViewportCameraController.h>
|
||||
#include <Atom/RPI.Public/ViewportContext.h>
|
||||
#include <Atom/RPI.Public/ViewportContextBus.h>
|
||||
#include <LmbrCentral/Rendering/EditorLightComponentBus.h> // for LmbrCentral::EditorLightComponentRequestBus
|
||||
|
||||
|
||||
// LmbrCentral
|
||||
#include <LmbrCentral/Rendering/EditorLightComponentBus.h> // for LmbrCentral::EditorLightComponentRequestBus
|
||||
|
||||
//#define PROFILE_LOADING_WITH_VTUNE
|
||||
|
||||
|
||||
@@ -533,7 +533,7 @@ namespace AzToolsFramework
|
||||
->Attribute(AZ::Script::Attributes::Scope, AZ::Script::Attributes::ScopeFlags::Automation);
|
||||
behaviorContext->EnumProperty<ESystemConfigPlatform::CONFIG_PC>("SystemConfigPlatform_Pc")
|
||||
->Attribute(AZ::Script::Attributes::Scope, AZ::Script::Attributes::ScopeFlags::Automation);
|
||||
behaviorContext->EnumProperty<ESystemConfigPlatform::CONFIG_OSX_GL>("SystemConfigPlatform_OsxGl")
|
||||
behaviorContext->EnumProperty<ESystemConfigPlatform::CONFIG_MAC>("SystemConfigPlatform_Mac")
|
||||
->Attribute(AZ::Script::Attributes::Scope, AZ::Script::Attributes::ScopeFlags::Automation);
|
||||
behaviorContext->EnumProperty<ESystemConfigPlatform::CONFIG_OSX_METAL>("SystemConfigPlatform_OsxMetal")
|
||||
->Attribute(AZ::Script::Attributes::Scope, AZ::Script::Attributes::ScopeFlags::Automation);
|
||||
|
||||
@@ -53,6 +53,7 @@
|
||||
|
||||
// AtomToolsFramework
|
||||
#include <AtomToolsFramework/Viewport/RenderViewportWidget.h>
|
||||
#include <AtomToolsFramework/Viewport/ModularViewportCameraController.h>
|
||||
|
||||
// CryCommon
|
||||
#include <CryCommon/HMDBus.h>
|
||||
@@ -75,7 +76,6 @@
|
||||
#include "EditorPreferencesPageGeneral.h"
|
||||
#include "ViewportManipulatorController.h"
|
||||
#include "LegacyViewportCameraController.h"
|
||||
#include "ModernViewportCameraController.h"
|
||||
#include "EditorViewportSettings.h"
|
||||
|
||||
#include "ViewPane.h"
|
||||
@@ -463,16 +463,20 @@ void EditorViewportWidget::Update()
|
||||
m_renderViewport->GetViewportContext()->SetCameraTransform(LYTransformToAZTransform(m_Camera.GetMatrix()));
|
||||
}
|
||||
|
||||
AZ::Matrix4x4 clipMatrix;
|
||||
AZ::MakePerspectiveFovMatrixRH(
|
||||
clipMatrix,
|
||||
m_Camera.GetFov(),
|
||||
aznumeric_cast<float>(width()) / aznumeric_cast<float>(height()),
|
||||
m_Camera.GetNearPlane(),
|
||||
m_Camera.GetFarPlane(),
|
||||
true
|
||||
);
|
||||
m_renderViewport->GetViewportContext()->SetCameraProjectionMatrix(clipMatrix);
|
||||
// Don't override the game mode FOV
|
||||
if (!GetIEditor()->IsInGameMode())
|
||||
{
|
||||
AZ::Matrix4x4 clipMatrix;
|
||||
AZ::MakePerspectiveFovMatrixRH(
|
||||
clipMatrix,
|
||||
GetFOV(),
|
||||
aznumeric_cast<float>(width()) / aznumeric_cast<float>(height()),
|
||||
m_Camera.GetNearPlane(),
|
||||
m_Camera.GetFarPlane(),
|
||||
true
|
||||
);
|
||||
m_renderViewport->GetViewportContext()->SetCameraProjectionMatrix(clipMatrix);
|
||||
}
|
||||
m_updatingCameraPosition = false;
|
||||
|
||||
|
||||
@@ -870,6 +874,13 @@ void EditorViewportWidget::OnBeginPrepareRender()
|
||||
int w = m_rcClient.width();
|
||||
int h = m_rcClient.height();
|
||||
|
||||
// Don't bother doing an FOV calculation if we don't have a valid viewport
|
||||
// This prevents frustum calculation bugs with a null viewport
|
||||
if (w <= 1 || h <= 1)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
float fov = gSettings.viewports.fDefaultFov;
|
||||
|
||||
// match viewport fov to default / selected title menu fov
|
||||
@@ -1220,51 +1231,74 @@ void EditorViewportWidget::SetViewportId(int id)
|
||||
{
|
||||
AzFramework::ReloadCameraKeyBindings();
|
||||
|
||||
auto controller = AZStd::make_shared<SandboxEditor::ModernViewportCameraController>();
|
||||
controller->SetCameraListBuilderCallback([](AzFramework::Cameras& cameras)
|
||||
{
|
||||
auto firstPersonRotateCamera = AZStd::make_shared<AzFramework::RotateCameraInput>(AzFramework::CameraFreeLookButton);
|
||||
auto firstPersonPanCamera =
|
||||
AZStd::make_shared<AzFramework::PanCameraInput>(AzFramework::CameraFreePanButton, AzFramework::LookPan);
|
||||
auto firstPersonTranslateCamera = AZStd::make_shared<AzFramework::TranslateCameraInput>(AzFramework::LookTranslation);
|
||||
auto firstPersonWheelCamera = AZStd::make_shared<AzFramework::ScrollTranslationCameraInput>();
|
||||
auto controller = AZStd::make_shared<AtomToolsFramework::ModularViewportCameraController>();
|
||||
controller->SetCameraListBuilderCallback(
|
||||
[](AzFramework::Cameras& cameras)
|
||||
{
|
||||
auto firstPersonRotateCamera = AZStd::make_shared<AzFramework::RotateCameraInput>(AzFramework::CameraFreeLookButton);
|
||||
auto firstPersonPanCamera =
|
||||
AZStd::make_shared<AzFramework::PanCameraInput>(AzFramework::CameraFreePanButton, AzFramework::LookPan);
|
||||
auto firstPersonTranslateCamera = AZStd::make_shared<AzFramework::TranslateCameraInput>(AzFramework::LookTranslation);
|
||||
auto firstPersonWheelCamera = AZStd::make_shared<AzFramework::ScrollTranslationCameraInput>();
|
||||
|
||||
auto orbitCamera = AZStd::make_shared<AzFramework::OrbitCameraInput>();
|
||||
orbitCamera->SetLookAtFn([]() -> AZStd::optional<AZ::Vector3> {
|
||||
AZStd::optional<AZ::Transform> manipulatorTransform;
|
||||
AzToolsFramework::EditorTransformComponentSelectionRequestBus::EventResult(
|
||||
manipulatorTransform, AzToolsFramework::GetEntityContextId(),
|
||||
&AzToolsFramework::EditorTransformComponentSelectionRequestBus::Events::GetManipulatorTransform);
|
||||
auto orbitCamera = AZStd::make_shared<AzFramework::OrbitCameraInput>();
|
||||
orbitCamera->SetLookAtFn(
|
||||
[](const AZ::Vector3& position, const AZ::Vector3& direction) -> AZStd::optional<AZ::Vector3>
|
||||
{
|
||||
AZStd::optional<AZ::Transform> manipulatorTransform;
|
||||
AzToolsFramework::EditorTransformComponentSelectionRequestBus::EventResult(
|
||||
manipulatorTransform, AzToolsFramework::GetEntityContextId(),
|
||||
&AzToolsFramework::EditorTransformComponentSelectionRequestBus::Events::GetManipulatorTransform);
|
||||
|
||||
if (manipulatorTransform)
|
||||
{
|
||||
return manipulatorTransform->GetTranslation();
|
||||
}
|
||||
// initially attempt to use manipulator transform if one exists (there is a selection)
|
||||
if (manipulatorTransform)
|
||||
{
|
||||
return manipulatorTransform->GetTranslation();
|
||||
}
|
||||
|
||||
return {};
|
||||
const float RayDistance = 1000.0f;
|
||||
AzFramework::RenderGeometry::RayRequest ray;
|
||||
ray.m_startWorldPosition = position;
|
||||
ray.m_endWorldPosition = position + direction * RayDistance;
|
||||
ray.m_onlyVisible = true;
|
||||
|
||||
AzFramework::RenderGeometry::RayResult renderGeometryIntersectionResult;
|
||||
AzFramework::RenderGeometry::IntersectorBus::EventResult(
|
||||
renderGeometryIntersectionResult, AzToolsFramework::GetEntityContextId(),
|
||||
&AzFramework::RenderGeometry::IntersectorInterface::RayIntersect, ray);
|
||||
|
||||
// attempt a ray intersection with any visible mesh and return the intersection position if successful
|
||||
if (renderGeometryIntersectionResult)
|
||||
{
|
||||
return renderGeometryIntersectionResult.m_worldPosition;
|
||||
}
|
||||
|
||||
// if there is no selection or no intersection, fallback to default camera orbit behavior (ground plane
|
||||
// intersection)
|
||||
return {};
|
||||
});
|
||||
|
||||
auto orbitRotateCamera = AZStd::make_shared<AzFramework::RotateCameraInput>(AzFramework::CameraOrbitLookButton);
|
||||
auto orbitTranslateCamera = AZStd::make_shared<AzFramework::TranslateCameraInput>(AzFramework::OrbitTranslation);
|
||||
auto orbitDollyWheelCamera = AZStd::make_shared<AzFramework::OrbitDollyScrollCameraInput>();
|
||||
auto orbitDollyMoveCamera =
|
||||
AZStd::make_shared<AzFramework::OrbitDollyCursorMoveCameraInput>(AzFramework::CameraOrbitDollyButton);
|
||||
auto orbitPanCamera =
|
||||
AZStd::make_shared<AzFramework::PanCameraInput>(AzFramework::CameraOrbitPanButton, AzFramework::OrbitPan);
|
||||
|
||||
orbitCamera->m_orbitCameras.AddCamera(orbitRotateCamera);
|
||||
orbitCamera->m_orbitCameras.AddCamera(orbitTranslateCamera);
|
||||
orbitCamera->m_orbitCameras.AddCamera(orbitDollyWheelCamera);
|
||||
orbitCamera->m_orbitCameras.AddCamera(orbitDollyMoveCamera);
|
||||
orbitCamera->m_orbitCameras.AddCamera(orbitPanCamera);
|
||||
|
||||
cameras.AddCamera(firstPersonRotateCamera);
|
||||
cameras.AddCamera(firstPersonPanCamera);
|
||||
cameras.AddCamera(firstPersonTranslateCamera);
|
||||
cameras.AddCamera(firstPersonWheelCamera);
|
||||
cameras.AddCamera(orbitCamera);
|
||||
});
|
||||
|
||||
auto orbitRotateCamera = AZStd::make_shared<AzFramework::RotateCameraInput>(AzFramework::CameraOrbitLookButton);
|
||||
auto orbitTranslateCamera = AZStd::make_shared<AzFramework::TranslateCameraInput>(AzFramework::OrbitTranslation);
|
||||
auto orbitDollyWheelCamera = AZStd::make_shared<AzFramework::OrbitDollyScrollCameraInput>();
|
||||
auto orbitDollyMoveCamera =
|
||||
AZStd::make_shared<AzFramework::OrbitDollyCursorMoveCameraInput>(AzFramework::CameraOrbitDollyButton);
|
||||
auto orbitPanCamera =
|
||||
AZStd::make_shared<AzFramework::PanCameraInput>(AzFramework::CameraOrbitPanButton, AzFramework::OrbitPan);
|
||||
|
||||
orbitCamera->m_orbitCameras.AddCamera(orbitRotateCamera);
|
||||
orbitCamera->m_orbitCameras.AddCamera(orbitTranslateCamera);
|
||||
orbitCamera->m_orbitCameras.AddCamera(orbitDollyWheelCamera);
|
||||
orbitCamera->m_orbitCameras.AddCamera(orbitDollyMoveCamera);
|
||||
orbitCamera->m_orbitCameras.AddCamera(orbitPanCamera);
|
||||
|
||||
cameras.AddCamera(firstPersonRotateCamera);
|
||||
cameras.AddCamera(firstPersonPanCamera);
|
||||
cameras.AddCamera(firstPersonTranslateCamera);
|
||||
cameras.AddCamera(firstPersonWheelCamera);
|
||||
cameras.AddCamera(orbitCamera);
|
||||
});
|
||||
|
||||
m_renderViewport->GetControllerList()->Add(controller);
|
||||
}
|
||||
else
|
||||
@@ -1759,9 +1793,6 @@ void EditorViewportWidget::SetViewTM(const Matrix34& viewTM, bool bMoveOnly)
|
||||
cameraObject->SetWorldTM(camMatrix * AZMatrix3x3ToLYMatrix3x3(lookThroughEntityCorrection));
|
||||
}
|
||||
}
|
||||
|
||||
using namespace AzToolsFramework;
|
||||
ComponentEntityObjectRequestBus::Event(cameraObject, &ComponentEntityObjectRequestBus::Events::UpdatePreemptiveUndoCache);
|
||||
}
|
||||
else if (m_viewEntityId.IsValid())
|
||||
{
|
||||
|
||||
@@ -34,6 +34,7 @@ CGotoPositionDlg::CGotoPositionDlg(QWidget* pParent /*=NULL*/)
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
||||
setFixedSize(size());
|
||||
OnInitDialog();
|
||||
|
||||
auto doubleValueChanged = static_cast<void(QDoubleSpinBox::*)(double)>(&QDoubleSpinBox::valueChanged);
|
||||
@@ -98,6 +99,9 @@ void CGotoPositionDlg::OnInitDialog()
|
||||
m_ui->m_dymSegX->setVisible(false);
|
||||
m_ui->m_dymSegY->setVisible(false);
|
||||
|
||||
// Ensure the goto button is highlighted correctly.
|
||||
m_ui->pushButton->setDefault(true);
|
||||
|
||||
OnUpdateNumbers();
|
||||
}
|
||||
|
||||
|
||||
@@ -6,189 +6,210 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>358</width>
|
||||
<height>198</height>
|
||||
<width>290</width>
|
||||
<height>180</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Go to Position</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout" columnstretch="0,1,0,0,1,0,0,1">
|
||||
<item row="6" column="0" colspan="2">
|
||||
<widget class="QPushButton" name="pushButton">
|
||||
<property name="text">
|
||||
<string>Go To</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="3" colspan="2">
|
||||
<widget class="QPushButton" name="pushButton_2">
|
||||
<property name="text">
|
||||
<string>Cancel</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="6" colspan="2">
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="3" column="2">
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>22</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<widget class="QDoubleSpinBox" name="m_dymZ"/>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="QDoubleSpinBox" name="m_dymY"/>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QDoubleSpinBox" name="m_dymX"/>
|
||||
</item>
|
||||
<item row="4" column="4">
|
||||
<widget class="QDoubleSpinBox" name="m_dymAngleY"/>
|
||||
</item>
|
||||
<item row="3" column="4">
|
||||
<widget class="QDoubleSpinBox" name="m_dymAngleX"/>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="label_8">
|
||||
<property name="text">
|
||||
<string>Z:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="3">
|
||||
<widget class="QLabel" name="label_7">
|
||||
<property name="text">
|
||||
<string>Y:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0" colspan="8">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Enter position here:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string>X:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0" colspan="8">
|
||||
<widget class="QLineEdit" name="m_posEdit">
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0" colspan="2">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Position:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="3">
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="text">
|
||||
<string>X:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="6">
|
||||
<widget class="QLabel" name="m_labelSegX">
|
||||
<property name="text">
|
||||
<string>X:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="4">
|
||||
<widget class="QDoubleSpinBox" name="m_dymAngleZ"/>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="label_6">
|
||||
<property name="text">
|
||||
<string>Y:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="6">
|
||||
<widget class="QLabel" name="m_labelSegY">
|
||||
<property name="text">
|
||||
<string>Y:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="3">
|
||||
<widget class="QLabel" name="label_9">
|
||||
<property name="text">
|
||||
<string>Z:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="5">
|
||||
<spacer name="horizontalSpacer_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>22</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="2" column="3" colspan="2">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>Angles:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="6" colspan="2">
|
||||
<widget class="QLabel" name="m_labelSeg">
|
||||
<property name="text">
|
||||
<string>Segments:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="7">
|
||||
<widget class="QSpinBox" name="m_dymSegX"/>
|
||||
</item>
|
||||
<item row="4" column="7">
|
||||
<widget class="QSpinBox" name="m_dymSegY"/>
|
||||
</item>
|
||||
</layout>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<layout class="QGridLayout" name="gridLayout" columnstretch="0,1,0,0,1,0,0,1">
|
||||
<item row="5" column="6" colspan="2">
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="3" column="2">
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>22</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<widget class="QDoubleSpinBox" name="m_dymZ"/>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="QDoubleSpinBox" name="m_dymY"/>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QDoubleSpinBox" name="m_dymX"/>
|
||||
</item>
|
||||
<item row="4" column="4">
|
||||
<widget class="QDoubleSpinBox" name="m_dymAngleY"/>
|
||||
</item>
|
||||
<item row="3" column="4">
|
||||
<widget class="QDoubleSpinBox" name="m_dymAngleX"/>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="label_8">
|
||||
<property name="text">
|
||||
<string>Z:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="3">
|
||||
<widget class="QLabel" name="label_7">
|
||||
<property name="text">
|
||||
<string>Y:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0" colspan="8">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Enter position here:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string>X:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0" colspan="8">
|
||||
<widget class="QLineEdit" name="m_posEdit">
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0" colspan="2">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Position:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="3">
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="text">
|
||||
<string>X:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="6">
|
||||
<widget class="QLabel" name="m_labelSegX">
|
||||
<property name="text">
|
||||
<string>X:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="4">
|
||||
<widget class="QDoubleSpinBox" name="m_dymAngleZ"/>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="label_6">
|
||||
<property name="text">
|
||||
<string>Y:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="6">
|
||||
<widget class="QLabel" name="m_labelSegY">
|
||||
<property name="text">
|
||||
<string>Y:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="3">
|
||||
<widget class="QLabel" name="label_9">
|
||||
<property name="text">
|
||||
<string>Z:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="5">
|
||||
<spacer name="horizontalSpacer_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>22</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="2" column="3" colspan="2">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>Angles:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="6" colspan="2">
|
||||
<widget class="QLabel" name="m_labelSeg">
|
||||
<property name="text">
|
||||
<string>Segments:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="7">
|
||||
<widget class="QSpinBox" name="m_dymSegX"/>
|
||||
</item>
|
||||
<item row="4" column="7">
|
||||
<widget class="QSpinBox" name="m_dymSegY"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="buttonLayout">
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_1">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton">
|
||||
<property name="text">
|
||||
<string>Go To</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_2">
|
||||
<property name="text">
|
||||
<string>Cancel</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<tabstops>
|
||||
<tabstop>m_posEdit</tabstop>
|
||||
|
||||
@@ -30,7 +30,7 @@ namespace LyViewPane
|
||||
static const char* const EntityInspector = "Entity Inspector";
|
||||
static const char* const EntityInspectorPinned = "Pinned Entity Inspector";
|
||||
static const char* const LevelInspector = "Level Inspector";
|
||||
static const char* const ProjectSettingsTool = "Project Settings Tool";
|
||||
static const char* const ProjectSettingsTool = "Edit Platform Settings...";
|
||||
static const char* const ErrorReport = "Error Report";
|
||||
static const char* const Console = "Console";
|
||||
static const char* const ConsoleMenuName = "&Console";
|
||||
|
||||
@@ -748,6 +748,9 @@ void MainWindow::InitActions()
|
||||
am->AddAction(ID_FILE_EXPORTOCCLUSIONMESH, tr("Export Occlusion Mesh"));
|
||||
am->AddAction(ID_FILE_EDITLOGFILE, tr("Show Log File"));
|
||||
am->AddAction(ID_FILE_RESAVESLICES, tr("Resave All Slices"));
|
||||
am->AddAction(ID_FILE_PROJECT_MANAGER_SETTINGS, tr("Edit Project Settings..."));
|
||||
am->AddAction(ID_FILE_PROJECT_MANAGER_NEW, tr("New Project..."));
|
||||
am->AddAction(ID_FILE_PROJECT_MANAGER_OPEN, tr("Open Project..."));
|
||||
am->AddAction(ID_GAME_PC_ENABLEVERYHIGHSPEC, tr("Very High")).SetCheckable(true)
|
||||
.RegisterUpdateCallback(cryEdit, &CCryEditApp::OnUpdateGameSpec);
|
||||
am->AddAction(ID_GAME_PC_ENABLEHIGHSPEC, tr("High")).SetCheckable(true)
|
||||
|
||||
@@ -1,185 +0,0 @@
|
||||
/*
|
||||
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
* its licensors.
|
||||
*
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this
|
||||
* distribution (the "License"). All use of this software is governed by the License,
|
||||
* or, if provided, by the license below or the license accompanying this file. Do not
|
||||
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "ModernViewportCameraController.h"
|
||||
|
||||
#include <Atom/RPI.Public/ViewportContext.h>
|
||||
#include <Atom/RPI.Public/ViewportContextBus.h>
|
||||
#include <AzCore/Console/IConsole.h>
|
||||
#include <AzCore/Interface/Interface.h>
|
||||
#include <AzFramework/Input/Devices/Keyboard/InputDeviceKeyboard.h>
|
||||
#include <AzFramework/Input/Devices/Mouse/InputDeviceMouse.h>
|
||||
#include <AzFramework/Viewport/ScreenGeometry.h>
|
||||
#include <AzFramework/Viewport/ViewportScreen.h>
|
||||
#include <AzFramework/Windowing/WindowBus.h>
|
||||
#include <AzToolsFramework/Viewport/ViewportMessages.h>
|
||||
|
||||
namespace SandboxEditor
|
||||
{
|
||||
// debug
|
||||
void DrawPreviewAxis(AzFramework::DebugDisplayRequests& display, const AZ::Transform& transform, const float axisLength)
|
||||
{
|
||||
display.SetColor(AZ::Colors::Red);
|
||||
display.DrawLine(transform.GetTranslation(), transform.GetTranslation() + transform.GetBasisX().GetNormalizedSafe() * axisLength);
|
||||
display.SetColor(AZ::Colors::Green);
|
||||
display.DrawLine(transform.GetTranslation(), transform.GetTranslation() + transform.GetBasisY().GetNormalizedSafe() * axisLength);
|
||||
display.SetColor(AZ::Colors::Blue);
|
||||
display.DrawLine(transform.GetTranslation(), transform.GetTranslation() + transform.GetBasisZ().GetNormalizedSafe() * axisLength);
|
||||
}
|
||||
|
||||
static AZ::RPI::ViewportContextPtr RetrieveViewportContext(const AzFramework::ViewportId viewportId)
|
||||
{
|
||||
auto viewportContextManager = AZ::Interface<AZ::RPI::ViewportContextRequestsInterface>::Get();
|
||||
if (!viewportContextManager)
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
auto viewportContext = viewportContextManager->GetViewportContextById(viewportId);
|
||||
if (!viewportContext)
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return viewportContext;
|
||||
}
|
||||
|
||||
void ModernViewportCameraController::SetCameraListBuilderCallback(const CameraListBuilder& builder)
|
||||
{
|
||||
m_cameraListBuilder = builder;
|
||||
}
|
||||
|
||||
void ModernViewportCameraController::SetupCameras(AzFramework::Cameras& cameras)
|
||||
{
|
||||
if (m_cameraListBuilder)
|
||||
{
|
||||
m_cameraListBuilder(cameras);
|
||||
}
|
||||
}
|
||||
|
||||
ModernViewportCameraControllerInstance::ModernViewportCameraControllerInstance(
|
||||
const AzFramework::ViewportId viewportId, ModernViewportCameraController* controller)
|
||||
: MultiViewportControllerInstanceInterface<ModernViewportCameraController>(viewportId, controller)
|
||||
{
|
||||
controller->SetupCameras(m_cameraSystem.m_cameras);
|
||||
|
||||
if (auto viewportContext = RetrieveViewportContext(GetViewportId()))
|
||||
{
|
||||
auto handleCameraChange = [this, viewportContext](const AZ::Matrix4x4&) {
|
||||
if (!m_updatingTransform)
|
||||
{
|
||||
UpdateCameraFromTransform(m_targetCamera, viewportContext->GetCameraTransform());
|
||||
m_camera = m_targetCamera;
|
||||
}
|
||||
};
|
||||
|
||||
m_cameraViewMatrixChangeHandler = AZ::RPI::ViewportContext::MatrixChangedEvent::Handler(handleCameraChange);
|
||||
|
||||
viewportContext->ConnectViewMatrixChangedHandler(m_cameraViewMatrixChangeHandler);
|
||||
}
|
||||
|
||||
AzFramework::ViewportDebugDisplayEventBus::Handler::BusConnect(AzToolsFramework::GetEntityContextId());
|
||||
ModernViewportCameraControllerRequestBus::Handler::BusConnect(viewportId);
|
||||
}
|
||||
|
||||
ModernViewportCameraControllerInstance::~ModernViewportCameraControllerInstance()
|
||||
{
|
||||
ModernViewportCameraControllerRequestBus::Handler::BusDisconnect();
|
||||
AzFramework::ViewportDebugDisplayEventBus::Handler::BusDisconnect();
|
||||
}
|
||||
|
||||
// should the camera system respond to this particular event
|
||||
static bool ShouldHandle(const AzFramework::ViewportControllerPriority priority, const bool exclusive)
|
||||
{
|
||||
// ModernViewportCameraControllerInstance receives events at all priorities, it should only respond
|
||||
// to normal priority events if it is not in 'exclusive' mode and when in 'exclusive' mode it should
|
||||
// only respond to the highest priority events
|
||||
return !exclusive && priority == AzFramework::ViewportControllerPriority::Normal ||
|
||||
exclusive && priority == AzFramework::ViewportControllerPriority::Highest;
|
||||
}
|
||||
|
||||
bool ModernViewportCameraControllerInstance::HandleInputChannelEvent(const AzFramework::ViewportControllerInputEvent& event)
|
||||
{
|
||||
if (ShouldHandle(event.m_priority, m_cameraSystem.m_cameras.Exclusive()))
|
||||
{
|
||||
return m_cameraSystem.HandleEvents(AzFramework::BuildInputEvent(event.m_inputChannel));
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void ModernViewportCameraControllerInstance::UpdateViewport(const AzFramework::ViewportControllerUpdateEvent& event)
|
||||
{
|
||||
// only update for a single priority (normal is the default)
|
||||
if (event.m_priority != AzFramework::ViewportControllerPriority::Normal)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (auto viewportContext = RetrieveViewportContext(GetViewportId()))
|
||||
{
|
||||
m_updatingTransform = true;
|
||||
|
||||
if (m_cameraMode == CameraMode::Control)
|
||||
{
|
||||
m_targetCamera = m_cameraSystem.StepCamera(m_targetCamera, event.m_deltaTime.count());
|
||||
m_camera = AzFramework::SmoothCamera(m_camera, m_targetCamera, event.m_deltaTime.count());
|
||||
|
||||
viewportContext->SetCameraTransform(m_camera.Transform());
|
||||
}
|
||||
else if (m_cameraMode == CameraMode::Animation)
|
||||
{
|
||||
const auto smootherStepFn = [](const float t) { return t * t * t * (t * (t * 6.0f - 15.0f) + 10.0f); };
|
||||
const float transitionT = smootherStepFn(m_animationT);
|
||||
|
||||
const AZ::Transform current = AZ::Transform::CreateFromQuaternionAndTranslation(
|
||||
m_transformStart.GetRotation().Slerp(m_transformEnd.GetRotation(), transitionT),
|
||||
m_transformStart.GetTranslation().Lerp(m_transformEnd.GetTranslation(), transitionT));
|
||||
|
||||
const AZ::Vector3 eulerAngles = AzFramework::EulerAngles(AZ::Matrix3x3::CreateFromTransform(current));
|
||||
m_camera.m_pitch = eulerAngles.GetX();
|
||||
m_camera.m_yaw = eulerAngles.GetZ();
|
||||
m_camera.m_lookAt = current.GetTranslation();
|
||||
m_targetCamera = m_camera;
|
||||
|
||||
if (m_animationT >= 1.0f)
|
||||
{
|
||||
m_cameraMode = CameraMode::Control;
|
||||
}
|
||||
|
||||
m_animationT = AZ::GetClamp(m_animationT + event.m_deltaTime.count(), 0.0f, 1.0f);
|
||||
|
||||
viewportContext->SetCameraTransform(current);
|
||||
}
|
||||
|
||||
m_updatingTransform = false;
|
||||
}
|
||||
}
|
||||
|
||||
void ModernViewportCameraControllerInstance::DisplayViewport(
|
||||
[[maybe_unused]] const AzFramework::ViewportInfo& viewportInfo, AzFramework::DebugDisplayRequests& debugDisplay)
|
||||
{
|
||||
if (const float alpha = AZStd::min(-m_camera.m_lookDist / 5.0f, 1.0f); alpha > AZ::Constants::FloatEpsilon)
|
||||
{
|
||||
debugDisplay.SetColor(1.0f, 1.0f, 1.0f, alpha);
|
||||
debugDisplay.DrawWireSphere(m_camera.m_lookAt, 0.5f);
|
||||
}
|
||||
}
|
||||
|
||||
void ModernViewportCameraControllerInstance::InterpolateToTransform(const AZ::Transform& worldFromLocal)
|
||||
{
|
||||
m_animationT = 0.0f;
|
||||
m_cameraMode = CameraMode::Animation;
|
||||
m_transformStart = m_camera.Transform();
|
||||
m_transformEnd = worldFromLocal;
|
||||
}
|
||||
} // namespace SandboxEditor
|
||||
@@ -1,79 +0,0 @@
|
||||
/*
|
||||
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
* its licensors.
|
||||
*
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this
|
||||
* distribution (the "License"). All use of this software is governed by the License,
|
||||
* or, if provided, by the license below or the license accompanying this file. Do not
|
||||
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <ModernViewportCameraControllerRequestBus.h>
|
||||
|
||||
#include <Atom/RPI.Public/ViewportContext.h>
|
||||
#include <AzFramework/Entity/EntityDebugDisplayBus.h>
|
||||
#include <AzFramework/Viewport/CameraInput.h>
|
||||
#include <AzFramework/Viewport/MultiViewportController.h>
|
||||
|
||||
namespace SandboxEditor
|
||||
{
|
||||
class ModernViewportCameraControllerInstance;
|
||||
class ModernViewportCameraController
|
||||
: public AzFramework::MultiViewportController<
|
||||
ModernViewportCameraControllerInstance, AzFramework::ViewportControllerPriority::DispatchToAllPriorities>
|
||||
{
|
||||
public:
|
||||
using CameraListBuilder = AZStd::function<void(AzFramework::Cameras&)>;
|
||||
|
||||
//! Sets the camera list builder callback used to populate new ModernViewportCameraControllerInstances
|
||||
void SetCameraListBuilderCallback(const CameraListBuilder& builder);
|
||||
//! Sets up a camera list based on this controller's CameraListBuilderCallback
|
||||
void SetupCameras(AzFramework::Cameras& cameras);
|
||||
|
||||
private:
|
||||
CameraListBuilder m_cameraListBuilder;
|
||||
};
|
||||
|
||||
class ModernViewportCameraControllerInstance final
|
||||
: public AzFramework::MultiViewportControllerInstanceInterface<ModernViewportCameraController>,
|
||||
public ModernViewportCameraControllerRequestBus::Handler,
|
||||
private AzFramework::ViewportDebugDisplayEventBus::Handler
|
||||
{
|
||||
public:
|
||||
explicit ModernViewportCameraControllerInstance(AzFramework::ViewportId viewportId, ModernViewportCameraController* controller);
|
||||
~ModernViewportCameraControllerInstance() override;
|
||||
|
||||
// MultiViewportControllerInstanceInterface overrides ...
|
||||
bool HandleInputChannelEvent(const AzFramework::ViewportControllerInputEvent& event) override;
|
||||
void UpdateViewport(const AzFramework::ViewportControllerUpdateEvent& event) override;
|
||||
|
||||
// ModernViewportCameraControllerRequestBus overrides ...
|
||||
void InterpolateToTransform(const AZ::Transform& worldFromLocal) override;
|
||||
|
||||
private:
|
||||
// AzFramework::ViewportDebugDisplayEventBus overrides ...
|
||||
void DisplayViewport(const AzFramework::ViewportInfo& viewportInfo, AzFramework::DebugDisplayRequests& debugDisplay) override;
|
||||
|
||||
enum class CameraMode
|
||||
{
|
||||
Control,
|
||||
Animation
|
||||
};
|
||||
|
||||
AzFramework::Camera m_camera;
|
||||
AzFramework::Camera m_targetCamera;
|
||||
AzFramework::CameraSystem m_cameraSystem;
|
||||
|
||||
AZ::Transform m_transformStart = AZ::Transform::CreateIdentity();
|
||||
AZ::Transform m_transformEnd = AZ::Transform::CreateIdentity();
|
||||
float m_animationT = 0.0f;
|
||||
CameraMode m_cameraMode = CameraMode::Control;
|
||||
bool m_updatingTransform = false;
|
||||
|
||||
AZ::RPI::ViewportContext::MatrixChangedEvent::Handler m_cameraViewMatrixChangeHandler;
|
||||
};
|
||||
} // namespace SandboxEditor
|
||||
@@ -1,42 +0,0 @@
|
||||
/*
|
||||
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
* its licensors.
|
||||
*
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this
|
||||
* distribution (the "License"). All use of this software is governed by the License,
|
||||
* or, if provided, by the license below or the license accompanying this file. Do not
|
||||
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AzCore/EBus/EBus.h>
|
||||
#include <AzFramework/Viewport/ViewportId.h>
|
||||
|
||||
namespace AZ
|
||||
{
|
||||
class Transform;
|
||||
}
|
||||
|
||||
namespace SandboxEditor
|
||||
{
|
||||
//! Provides an interface to control the modern viewport camera controller from the Editor.
|
||||
//! @note The bus is addressed by viewport id.
|
||||
class ModernViewportCameraControllerRequests : public AZ::EBusTraits
|
||||
{
|
||||
public:
|
||||
using BusIdType = AzFramework::ViewportId;
|
||||
static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::ById;
|
||||
static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Single;
|
||||
|
||||
//! Begin a smooth transition of the camera to the requested transform.
|
||||
virtual void InterpolateToTransform(const AZ::Transform& worldFromLocal) = 0;
|
||||
|
||||
protected:
|
||||
~ModernViewportCameraControllerRequests() = default;
|
||||
};
|
||||
|
||||
using ModernViewportCameraControllerRequestBus = AZ::EBus<ModernViewportCameraControllerRequests>;
|
||||
} // namespace SandboxEditor
|
||||
@@ -482,28 +482,6 @@ void CSelectionGroup::StartScaling()
|
||||
}
|
||||
|
||||
|
||||
void CSelectionGroup::FinishScaling(const Vec3& scale, [[maybe_unused]] int referenceCoordSys)
|
||||
{
|
||||
if (fabs(scale.x - scale.y) < 0.001f &&
|
||||
fabs(scale.y - scale.z) < 0.001f &&
|
||||
fabs(scale.z - scale.x) < 0.001f)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for (int i = 0; i < GetFilteredCount(); ++i)
|
||||
{
|
||||
CBaseObject* obj = GetFilteredObject(i);
|
||||
Vec3 OriginalScale;
|
||||
if (obj->GetUntransformedScale(OriginalScale))
|
||||
{
|
||||
obj->TransformScale(scale);
|
||||
obj->SetScale(OriginalScale);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void CSelectionGroup::Align()
|
||||
{
|
||||
|
||||
@@ -103,7 +103,6 @@ public:
|
||||
void StartScaling();
|
||||
void Scale(const Vec3& scale, int referenceCoordSys);
|
||||
void SetScale(const Vec3& scale, int referenceCoordSys);
|
||||
void FinishScaling(const Vec3& scale, int referenceCoordSys);
|
||||
//! Align objects in selection to surface normal
|
||||
void Align();
|
||||
//! Very special method to move contents of a voxel.
|
||||
|
||||
@@ -1259,9 +1259,6 @@ CBaseObject* CRenderViewport::GetCameraObject() const
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void CRenderViewport::OnEditorNotifyEvent(EEditorNotifyEvent event)
|
||||
{
|
||||
static ICVar* outputToHMD = gEnv->pConsole->GetCVar("output_to_hmd");
|
||||
AZ_Assert(outputToHMD, "cvar output_to_hmd is undeclared");
|
||||
|
||||
switch (event)
|
||||
{
|
||||
case eNotify_OnBeginGameMode:
|
||||
@@ -1282,7 +1279,6 @@ void CRenderViewport::OnEditorNotifyEvent(EEditorNotifyEvent event)
|
||||
|
||||
if (deviceInfo)
|
||||
{
|
||||
outputToHMD->Set(1);
|
||||
m_previousContext = SetCurrentContext(deviceInfo->renderWidth, deviceInfo->renderHeight);
|
||||
if (m_renderer->GetIStereoRenderer())
|
||||
{
|
||||
@@ -1313,10 +1309,6 @@ void CRenderViewport::OnEditorNotifyEvent(EEditorNotifyEvent event)
|
||||
// failed to set the context back when done, or set it back to the wrong one.
|
||||
CryWarning(VALIDATOR_MODULE_3DENGINE, VALIDATOR_WARNING, "RenderViewport render context was not correctly restored by someone else.");
|
||||
}
|
||||
if (gSettings.bEnableGameModeVR)
|
||||
{
|
||||
outputToHMD->Set(0);
|
||||
}
|
||||
RestorePreviousContext(m_previousContext);
|
||||
m_bInRotateMode = false;
|
||||
m_bInMoveMode = false;
|
||||
|
||||
@@ -200,6 +200,7 @@ public:
|
||||
{
|
||||
return {};
|
||||
}
|
||||
float DeviceScalingFactor() override { return 1.0f; }
|
||||
|
||||
// AzToolsFramework::ViewportFreezeRequestBus
|
||||
bool IsViewportInputFrozen() override;
|
||||
|
||||
@@ -313,6 +313,9 @@
|
||||
#define ID_CREATE_LEVEL_FG_MODULE_FROM_SELECTION 35077
|
||||
#define ID_GRAPHVIEW_ADD_BLACK_BOX 35078
|
||||
#define ID_GRAPHVIEW_UNGROUP 35079
|
||||
#define ID_FILE_PROJECT_MANAGER_NEW 35080
|
||||
#define ID_FILE_PROJECT_MANAGER_OPEN 35081
|
||||
#define ID_FILE_PROJECT_MANAGER_SETTINGS 35082
|
||||
#define ID_TV_TRACKS_TOOLBAR_BASE 35083 // range between ID_TV_TRACKS_TOOLBAR_BASE to ID_TV_TRACKS_TOOLBAR_LAST reserved
|
||||
#define ID_TV_TRACKS_TOOLBAR_LAST 35183 // for up to 100 "Add Tracks..." dynamically added Track View Track buttons
|
||||
#define ID_OPEN_TERRAIN_EDITOR 36007
|
||||
|
||||
@@ -42,14 +42,14 @@
|
||||
<widget class="QSvgWidget" name="m_logo" native="true">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>161</width>
|
||||
<height>49</height>
|
||||
<width>175</width>
|
||||
<height>66</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>161</width>
|
||||
<height>50</height>
|
||||
<width>175</width>
|
||||
<height>66</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
|
||||
@@ -2012,9 +2012,9 @@ void CTrackViewAnimNode::SetPosRotScaleTracksDefaultValues(bool positionAllowed,
|
||||
}
|
||||
if (scaleAllowed)
|
||||
{
|
||||
AZ::Vector3 scale = AZ::Vector3::CreateOne();
|
||||
AZ::TransformBus::EventResult(scale, entityId, &AZ::TransformBus::Events::GetWorldScale);
|
||||
m_animNode->SetScale(time, AZVec3ToLYVec3(scale));
|
||||
float scale = 1.0f;
|
||||
AZ::TransformBus::EventResult(scale, entityId, &AZ::TransformBus::Events::GetWorldUniformScale);
|
||||
m_animNode->SetScale(time, Vec3(scale, scale, scale));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -828,7 +828,7 @@ void CTrackViewSequence::SyncSelectedTracksToBase()
|
||||
const Vec3 scale = pAnimNode->GetScale();
|
||||
|
||||
AZ::Transform transform = AZ::Transform::CreateIdentity();
|
||||
transform.SetScale(LYVec3ToAZVec3(scale));
|
||||
transform.SetUniformScale(LYVec3ToAZVec3(scale).GetMaxElement());
|
||||
transform.SetRotation(LYQuaternionToAZQuaternion(rotation));
|
||||
transform.SetTranslation(LYVec3ToAZVec3(position));
|
||||
|
||||
@@ -870,7 +870,7 @@ void CTrackViewSequence::SyncSelectedTracksFromBase()
|
||||
|
||||
pAnimNode->SetPos(AZVec3ToLYVec3(transform.GetTranslation()));
|
||||
pAnimNode->SetRotation(AZQuaternionToLYQuaternion(transform.GetRotation()));
|
||||
pAnimNode->SetScale(AZVec3ToLYVec3(transform.GetScale()));
|
||||
pAnimNode->SetScale(AZVec3ToLYVec3(AZ::Vector3(transform.GetUniformScale())));
|
||||
|
||||
bNothingWasSynced = false;
|
||||
}
|
||||
|
||||
@@ -823,9 +823,6 @@ set(FILES
|
||||
ViewportManipulatorController.h
|
||||
LegacyViewportCameraController.cpp
|
||||
LegacyViewportCameraController.h
|
||||
ModernViewportCameraController.cpp
|
||||
ModernViewportCameraController.h
|
||||
ModernViewportCameraControllerRequestBus.h
|
||||
RenderViewport.cpp
|
||||
RenderViewport.h
|
||||
TopRendererWnd.cpp
|
||||
|
||||
@@ -1,22 +1,35 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="323px" height="98px" viewBox="0 0 323 98" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<title>Group 12</title>
|
||||
<defs>
|
||||
<polygon id="path-1" points="0 97.741 322.084 97.741 322.084 0 0 0"></polygon>
|
||||
</defs>
|
||||
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<g id="Group-12" transform="translate(0.000000, 0.000000)">
|
||||
<path d="M99.7068,20.425 C91.1008,11.686 79.6658,6.841 67.5068,6.782 L67.2838,6.781 C62.9678,6.781 58.7408,7.396 54.6908,8.566 L54.6908,25.339 C58.5158,23.54 62.6988,22.563 67.0218,22.517 C67.1388,22.516 67.2538,22.515 67.3698,22.515 C75.1318,22.515 82.4608,25.519 88.0388,30.996 C93.7828,36.635 96.9708,44.124 97.0168,52.084 C97.0628,60.037 93.9658,67.554 88.2968,73.251 C82.6908,78.884 75.2578,82 67.3558,82.025 L67.2718,82.025 C59.4228,82.025 51.9878,78.959 46.3368,73.393 C40.6918,67.833 37.5578,60.397 37.5108,52.453 C37.4888,48.659 38.1798,44.975 39.5088,41.546 L23.0748,41.546 C19.4908,56.362 23.4348,72.648 34.9328,84.219 C43.5408,92.882 54.9608,97.683 67.0878,97.738 L67.3028,97.738 L67.3058,97.738 C79.3458,97.738 90.7008,93.045 99.2768,84.524 C107.8718,75.984 112.6488,64.62 112.7288,52.524 C112.8088,40.435 108.1838,29.035 99.7068,20.425" id="Fill-1" fill="#FFFFFF"></path>
|
||||
<path d="M175.6326,27.8629 C175.6326,33.3889 173.9586,38.0879 170.6116,41.9599 C167.2646,45.8319 162.5656,48.4939 156.5146,49.9459 L156.5146,50.3089 C163.6536,51.1969 169.0586,53.3629 172.7296,56.8129 C176.3996,60.2619 178.2356,64.9099 178.2356,70.7579 C178.2356,79.2689 175.1496,85.8939 168.9786,90.6319 C162.8076,95.3719 153.9936,97.7409 142.5386,97.7409 C132.9386,97.7409 124.4286,96.1489 117.0076,92.9609 L117.0076,77.0489 C120.4356,78.7839 124.2076,80.1959 128.3216,81.2839 C132.4356,82.3729 136.5096,82.9179 140.5426,82.9179 C146.7146,82.9179 151.2716,81.8699 154.2156,79.7719 C157.1596,77.6749 158.6326,74.3079 158.6326,69.6679 C158.6326,65.5139 156.9386,62.5699 153.5506,60.8349 C150.1626,59.1009 144.7576,58.2329 137.3366,58.2329 L130.6206,58.2329 L130.6206,43.8939 L137.4576,43.8939 C144.3146,43.8939 149.3246,42.9979 152.4916,41.2019 C155.6576,39.4079 157.2406,36.3319 157.2406,31.9759 C157.2406,25.2809 153.0456,21.9329 144.6566,21.9329 C141.7526,21.9329 138.7986,22.4169 135.7936,23.3849 C132.7886,24.3529 129.4506,26.0279 125.7806,28.4069 L117.1306,15.5199 C125.1956,9.7119 134.8166,6.8079 145.9886,6.8079 C155.1446,6.8079 162.3736,8.6639 167.6786,12.3739 C172.9806,16.0869 175.6326,21.2499 175.6326,27.8629" id="Fill-3" fill="#FFFFFF"></path>
|
||||
<path d="M241.8563,51.9425 C241.8563,32.9455 233.4653,23.4465 216.6883,23.4465 L206.7053,23.4465 L206.7053,81.0435 L214.7523,81.0435 C232.8213,81.0435 241.8563,71.3435 241.8563,51.9425 M261.3363,51.4595 C261.3363,66.0195 257.1933,77.1715 248.9043,84.9165 C240.6153,92.6605 228.6463,96.5325 212.9973,96.5325 L187.9503,96.5325 L187.9503,8.0815 L215.7193,8.0815 C230.1593,8.0815 241.3723,11.8925 249.3583,19.5155 C257.3433,27.1365 261.3363,37.7855 261.3363,51.4595" id="Fill-5" fill="#FFFFFF"></path>
|
||||
<mask id="mask-2" fill="white">
|
||||
<use xlink:href="#path-1"></use>
|
||||
</mask>
|
||||
<g id="Clip-8"></g>
|
||||
<polygon id="Fill-7" fill="#FFFFFF" mask="url(#mask-2)" points="23.185 30.421 45.046 30.421 45.046 8.56 23.185 8.56"></polygon>
|
||||
<polygon id="Fill-9" fill="#FFFFFF" mask="url(#mask-2)" points="5.251 9.038 14.289 9.038 14.289 0 5.251 0"></polygon>
|
||||
<polygon id="Fill-10" fill="#FFFFFF" mask="url(#mask-2)" points="0 36.195 14.18 36.195 14.18 22.015 0 22.015"></polygon>
|
||||
<polygon id="Fill-11" fill="#FFFFFF" mask="url(#mask-2)" points="322.0838 96.4337 271.0538 96.4337 271.0538 7.8287 322.0838 7.8287 322.0838 23.2227 289.8418 23.2227 289.8418 42.6767 319.8418 42.6767 319.8418 58.0707 289.8418 58.0707 289.8418 80.9187 322.0838 80.9187"></polygon>
|
||||
<svg width="350px" height="133px" viewBox="0 0 350 133" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<title>Artboard</title>
|
||||
<g id="Artboard" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<g id="O3DE-Logo-with-WorkMark-REV-Mono" transform="translate(-0.060000, 0.000000)" fill="#FFFFFF">
|
||||
<g id="Group-3" transform="translate(25.446000, 117.517000)">
|
||||
<path d="M1.833,7.614 C1.833,9.618 2.262,11.139 3.121,12.175 C3.979,13.211 5.226,13.729 6.863,13.729 C8.511,13.729 9.758,13.212 10.599,12.18 C11.441,11.146 11.862,9.625 11.862,7.614 C11.862,5.623 11.443,4.113 10.604,3.083 C9.766,2.055 8.525,1.539 6.883,1.539 C5.234,1.539 3.979,2.057 3.121,3.093 C2.262,4.129 1.833,5.637 1.833,7.614 Z M13.694,7.614 C13.694,9.983 13.092,11.846 11.887,13.202 C10.683,14.559 9.007,15.237 6.863,15.237 C4.67,15.237 2.979,14.571 1.787,13.237 C0.596,11.904 3.55271368e-15,10.023 3.55271368e-15,7.594 C3.55271368e-15,5.184 0.597,3.315 1.792,1.989 C2.986,0.663 4.683,0 6.883,0 C9.022,0 10.692,0.676 11.892,2.025 C13.095,3.375 13.694,5.238 13.694,7.614 L13.694,7.614 Z" id="Fill-1"></path>
|
||||
</g>
|
||||
<path d="M55.659,125.252 L57.216,125.252 C58.75,125.252 59.86,125.005 60.546,124.513 C61.231,124.02 61.574,123.231 61.574,122.144 C61.574,121.165 61.251,120.436 60.606,119.956 C59.961,119.478 58.958,119.239 57.593,119.239 L55.659,119.239 L55.659,125.252 Z M63.366,122.063 C63.366,123.561 62.852,124.714 61.823,125.521 C60.795,126.327 59.324,126.731 57.41,126.731 L55.659,126.731 L55.659,132.551 L53.927,132.551 L53.927,117.749 L57.786,117.749 C61.506,117.749 63.366,119.188 63.366,122.063 L63.366,122.063 Z" id="Fill-4"></path>
|
||||
<polyline id="Fill-5" points="86.247 132.551 77.949 132.551 77.949 117.749 86.247 117.749 86.247 119.279 79.681 119.279 79.681 124.047 85.849 124.047 85.849 125.566 79.681 125.566 79.681 131.013 86.247 131.013 86.247 132.551"></polyline>
|
||||
<g id="Group-9" transform="translate(101.016000, 117.537000)">
|
||||
<path d="M11.628,15.014 L9.651,15.014 L1.517,2.592 L1.436,2.592 C1.544,4.05 1.599,5.387 1.599,6.602 L1.599,15.014 L-1.42108547e-14,15.014 L-1.42108547e-14,0.212 L1.954,0.212 L10.069,12.584 L10.151,12.584 C10.137,12.403 10.106,11.817 10.059,10.828 C10.011,9.839 9.995,9.133 10.008,8.707 L10.008,0.212 L11.628,0.212 L11.628,15.014" id="Fill-6"></path>
|
||||
<path d="M56.235,3.696 C56.235,4.64 55.968,5.413 55.436,6.014 C54.902,6.616 54.147,7.016 53.169,7.219 L53.169,7.3 C54.364,7.449 55.251,7.827 55.828,8.434 C56.404,9.041 56.693,9.837 56.693,10.823 C56.693,12.234 56.201,13.319 55.216,14.079 C54.232,14.837 52.834,15.217 51.022,15.217 C50.234,15.217 49.513,15.159 48.858,15.039 C48.203,14.922 47.567,14.714 46.949,14.417 L46.949,12.818 C47.594,13.135 48.281,13.376 49.011,13.541 C49.741,13.707 50.431,13.789 51.083,13.789 C53.655,13.789 54.942,12.788 54.942,10.783 C54.942,8.987 53.522,8.089 50.685,8.089 L49.219,8.089 L49.219,6.642 L50.707,6.642 C51.866,6.642 52.787,6.387 53.465,5.877 C54.144,5.369 54.483,4.661 54.483,3.756 C54.483,3.034 54.234,2.467 53.735,2.055 C53.236,1.644 52.559,1.438 51.704,1.438 C51.052,1.438 50.438,1.526 49.861,1.702 C49.284,1.877 48.626,2.201 47.886,2.673 L47.031,1.539 C47.642,1.06 48.345,0.683 49.144,0.411 C49.94,0.136 50.78,1.42108547e-14 51.663,1.42108547e-14 C53.109,1.42108547e-14 54.232,0.33 55.033,0.987 C55.834,1.646 56.235,2.548 56.235,3.696" id="Fill-8"></path>
|
||||
</g>
|
||||
<path d="M182.497,125.07 C182.497,123.14 182.009,121.685 181.035,120.706 C180.061,119.727 178.614,119.239 176.693,119.239 L174.178,119.239 L174.178,131.064 L176.286,131.064 C178.349,131.064 179.9,130.56 180.939,129.55 C181.976,128.541 182.497,127.048 182.497,125.07 Z M184.329,125.009 C184.329,127.452 183.662,129.321 182.329,130.613 C180.995,131.906 179.076,132.551 176.571,132.551 L172.447,132.551 L172.447,117.749 L177.008,117.749 C179.323,117.749 181.122,118.388 182.405,119.663 C183.687,120.94 184.329,122.721 184.329,125.009 L184.329,125.009 Z" id="Fill-10"></path>
|
||||
<polyline id="Fill-11" points="228.264 132.551 219.965 132.551 219.965 117.749 228.264 117.749 228.264 119.279 221.697 119.279 221.697 124.047 227.867 124.047 227.867 125.566 221.697 125.566 221.697 131.013 228.264 131.013 228.264 132.551"></polyline>
|
||||
<g id="Group-15" transform="translate(243.032000, 117.537000)">
|
||||
<path d="M11.629,15.014 L9.652,15.014 L1.517,2.592 L1.436,2.592 C1.545,4.05 1.599,5.387 1.599,6.602 L1.599,15.014 L2.84217094e-14,15.014 L2.84217094e-14,0.212 L1.955,0.212 L10.07,12.584 L10.151,12.584 C10.138,12.403 10.107,11.817 10.059,10.828 C10.011,9.839 9.996,9.133 10.008,8.707 L10.008,0.212 L11.629,0.212 L11.629,15.014" id="Fill-12"></path>
|
||||
<path d="M33.736,7.259 L38.796,7.259 L38.796,14.458 C38.008,14.707 37.208,14.897 36.393,15.025 C35.578,15.154 34.634,15.217 33.563,15.217 C31.309,15.217 29.554,14.551 28.299,13.217 C27.044,11.884 26.415,10.017 26.415,7.614 C26.415,6.076 26.726,4.727 27.346,3.569 C27.968,2.413 28.862,1.528 30.03,0.916 C31.197,0.306 32.564,1.42108547e-14 34.133,1.42108547e-14 C35.721,1.42108547e-14 37.201,0.29 38.573,0.872 L37.9,2.39 C36.555,1.823 35.263,1.539 34.021,1.539 C32.209,1.539 30.794,2.076 29.776,3.149 C28.757,4.222 28.248,5.71 28.248,7.614 C28.248,9.612 28.738,11.126 29.719,12.16 C30.7,13.192 32.14,13.709 34.042,13.709 C35.073,13.709 36.081,13.59 37.066,13.354 L37.066,8.798 L33.736,8.798 L33.736,7.259" id="Fill-14"></path>
|
||||
</g>
|
||||
<polygon id="Fill-16" points="296.871 132.551 298.602 132.551 298.602 117.749 296.871 117.749"></polygon>
|
||||
<path d="M325.781,132.551 L323.805,132.551 L315.67,120.129 L315.588,120.129 C315.698,121.587 315.751,122.924 315.751,124.139 L315.751,132.551 L314.153,132.551 L314.153,117.749 L316.108,117.749 L324.223,130.121 L324.304,130.121 C324.29,129.94 324.259,129.354 324.212,128.365 C324.164,127.376 324.148,126.67 324.162,126.244 L324.162,117.749 L325.781,117.749 L325.781,132.551" id="Fill-17"></path>
|
||||
<polyline id="Fill-18" points="349.64 132.551 341.341 132.551 341.341 117.749 349.64 117.749 349.64 119.279 343.073 119.279 343.073 124.047 349.243 124.047 349.243 125.566 343.073 125.566 343.073 131.013 349.64 131.013 349.64 132.551"></polyline>
|
||||
<path d="M187.562,26.549 C187.562,32.293 185.822,37.178 182.341,41.203 C178.861,45.228 173.977,47.995 167.687,49.505 L167.687,49.882 C175.109,50.805 180.727,53.058 184.543,56.643 C188.358,60.228 190.266,65.061 190.266,71.14 C190.266,79.989 187.059,86.875 180.644,91.801 C174.228,96.728 165.067,99.191 153.159,99.191 C143.18,99.191 134.332,97.535 126.618,94.222 L126.618,77.681 C130.181,79.485 134.102,80.951 138.379,82.083 C142.656,83.216 146.891,83.781 151.083,83.781 C157.498,83.781 162.236,82.693 165.297,80.511 C168.358,78.331 169.889,74.831 169.889,70.008 C169.889,65.69 168.128,62.63 164.606,60.825 C161.083,59.023 155.464,58.121 147.75,58.121 L140.769,58.121 L140.769,43.216 L147.876,43.216 C155.004,43.216 160.213,42.283 163.505,40.417 C166.796,38.551 168.442,35.354 168.442,30.825 C168.442,23.865 164.081,20.385 155.36,20.385 C152.341,20.385 149.269,20.888 146.146,21.894 C143.022,22.901 139.552,24.642 135.737,27.115 L126.744,13.718 C135.129,7.68 145.129,4.661 156.744,4.661 C166.262,4.661 173.777,6.591 179.291,10.448 C184.804,14.305 187.562,19.673 187.562,26.549" id="Fill-19"></path>
|
||||
<path d="M261.093,51.538 C261.093,31.236 252.127,21.084 234.196,21.084 L223.527,21.084 L223.527,82.639 L232.126,82.639 C251.437,82.639 261.093,72.273 261.093,51.538 Z M281.913,51.021 C281.913,66.583 277.484,78.5 268.625,86.777 C259.768,95.053 246.976,99.191 230.251,99.191 L203.483,99.191 L203.483,4.661 L233.162,4.661 C248.592,4.661 260.576,8.735 269.111,16.882 C277.646,25.029 281.913,36.408 281.913,51.021 L281.913,51.021 Z" id="Fill-20"></path>
|
||||
<polyline id="Fill-21" points="349.64 99.191 295.198 99.191 295.198 4.661 349.64 4.661 349.64 21.084 315.242 21.084 315.242 41.84 347.247 41.84 347.247 58.262 315.242 58.262 315.242 82.639 349.64 82.639 349.64 99.191"></polyline>
|
||||
<path d="M72.71,4.661 C68.177,4.661 63.799,5.313 59.648,6.505 L59.648,24.983 C63.596,23.066 68.027,21.988 72.71,21.988 C89.245,21.988 102.648,35.392 102.648,51.926 C102.648,68.46 89.245,81.865 72.71,81.865 C56.176,81.865 42.773,68.46 42.773,51.926 C42.773,47.99 43.539,44.237 44.92,40.794 L26.777,40.794 C25.914,44.365 25.446,48.09 25.446,51.926 C25.446,78.03 46.607,99.191 72.71,99.191 C98.814,99.191 119.976,78.03 119.976,51.926 C119.976,25.823 98.814,4.661 72.71,4.661" id="Fill-22"></path>
|
||||
<g id="Group-27">
|
||||
<polyline id="Fill-23" points="53.023 29.655 30.237 34.445 25.447 11.66 48.232 6.869 53.023 29.655"></polyline>
|
||||
<polygon id="Fill-25" points="11.806 9.313 21.12 9.313 21.12 0 11.806 0"></polygon>
|
||||
<polyline id="Fill-26" points="14.761 31.326 0 27.533 3.793 12.773 18.554 16.566 14.761 31.326"></polyline>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 8.9 KiB |
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:c042fce57915fc749abc7b37de765fd697c3c4d7de045a3d44805aa0ce29901a
|
||||
size 107016
|
||||
oid sha256:d717f77fe01f45df934a61bbc215e5322447d21e16f3cebcf2a02f148178f266
|
||||
size 106449
|
||||
|
||||
@@ -35,9 +35,12 @@ ly_add_target(
|
||||
AZ::AzToolsFramework
|
||||
Legacy::CryCommon
|
||||
Legacy::EditorLib
|
||||
Gem::LmbrCentral
|
||||
AZ::AtomCore
|
||||
Gem::Atom_RPI.Public
|
||||
Gem::AtomToolsFramework.Static
|
||||
Gem::LmbrCentral.Editor
|
||||
RUNTIME_DEPENDENCIES
|
||||
Gem::LmbrCentral.Editor
|
||||
)
|
||||
|
||||
ly_add_dependencies(Editor ComponentEntityEditorPlugin)
|
||||
@@ -67,7 +70,9 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED)
|
||||
AZ::AzToolsFrameworkTestCommon
|
||||
Legacy::CryCommon
|
||||
Legacy::EditorLib
|
||||
Gem::LmbrCentral
|
||||
Gem::LmbrCentral.Editor
|
||||
RUNTIME_DEPENDENCIES
|
||||
Gem::LmbrCentral.Editor
|
||||
)
|
||||
ly_add_googletest(
|
||||
NAME Legacy::ComponentEntityEditorPlugin.Tests
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
#include <AzFramework/StringFunc/StringFunc.h>
|
||||
#include <AzFramework/Visibility/BoundsBus.h>
|
||||
#include <AzToolsFramework/API/EditorAssetSystemAPI.h>
|
||||
#include <AzToolsFramework/API/EditorEntityAPI.h>
|
||||
#include <AzToolsFramework/API/EntityCompositionRequestBus.h>
|
||||
#include <AzToolsFramework/API/ToolsApplicationAPI.h>
|
||||
#include <AzToolsFramework/AssetBrowser/AssetBrowserBus.h>
|
||||
@@ -65,8 +66,8 @@
|
||||
|
||||
#include <Atom/RPI.Public/ViewportContext.h>
|
||||
#include <Atom/RPI.Public/ViewportContextBus.h>
|
||||
#include <AtomToolsFramework/Viewport/ModularViewportCameraControllerRequestBus.h>
|
||||
|
||||
#include <ModernViewportCameraControllerRequestBus.h>
|
||||
|
||||
#include "Objects/ComponentEntityObject.h"
|
||||
#include "ISourceControl.h"
|
||||
@@ -192,6 +193,9 @@ void SandboxIntegrationManager::Setup()
|
||||
(m_prefabIntegrationInterface != nullptr),
|
||||
"SandboxIntegrationManager requires a PrefabIntegrationInterface instance to be present on Setup().");
|
||||
|
||||
m_editorEntityAPI = AZ::Interface<AzToolsFramework::EditorEntityAPI>::Get();
|
||||
AZ_Assert(m_editorEntityAPI, "SandboxIntegrationManager requires an EditorEntityAPI instance to be present on Setup().");
|
||||
|
||||
AzToolsFramework::Layers::EditorLayerComponentNotificationBus::Handler::BusConnect();
|
||||
}
|
||||
|
||||
@@ -378,11 +382,6 @@ void SandboxIntegrationManager::Teardown()
|
||||
{
|
||||
AzToolsFramework::Layers::EditorLayerComponentNotificationBus::Handler::BusDisconnect();
|
||||
AzFramework::DisplayContextRequestBus::Handler::BusDisconnect();
|
||||
if( m_debugDisplayBusImplementationActive)
|
||||
{
|
||||
AzFramework::DebugDisplayRequestBus::Handler::BusDisconnect();
|
||||
m_debugDisplayBusImplementationActive = false;
|
||||
}
|
||||
AzToolsFramework::SliceEditorEntityOwnershipServiceNotificationBus::Handler::BusDisconnect();
|
||||
AzToolsFramework::EditorEntityContextNotificationBus::Handler::BusDisconnect();
|
||||
AzToolsFramework::EditorEvents::Bus::Handler::BusDisconnect();
|
||||
@@ -1215,9 +1214,20 @@ void SandboxIntegrationManager::CloneSelection(bool& handled)
|
||||
|
||||
if (!duplicationSet.empty())
|
||||
{
|
||||
AZStd::unordered_set<AZ::EntityId> clonedEntities;
|
||||
handled = AzToolsFramework::CloneInstantiatedEntities(duplicationSet, clonedEntities);
|
||||
m_unsavedEntities.insert(clonedEntities.begin(), clonedEntities.end());
|
||||
bool prefabSystemEnabled = false;
|
||||
AzFramework::ApplicationRequests::Bus::BroadcastResult(prefabSystemEnabled, &AzFramework::ApplicationRequests::IsPrefabSystemEnabled);
|
||||
|
||||
if (prefabSystemEnabled)
|
||||
{
|
||||
m_editorEntityAPI->DuplicateSelected();
|
||||
handled = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
AZStd::unordered_set<AZ::EntityId> clonedEntities;
|
||||
handled = AzToolsFramework::CloneInstantiatedEntities(duplicationSet, clonedEntities);
|
||||
m_unsavedEntities.insert(clonedEntities.begin(), clonedEntities.end());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1726,9 +1736,9 @@ void SandboxIntegrationManager::GoToEntitiesInViewports(const AzToolsFramework::
|
||||
const AZ::Transform nextCameraTransform =
|
||||
AZ::Transform::CreateLookAt(aabb.GetCenter() - (forward * distanceToTarget), aabb.GetCenter());
|
||||
|
||||
SandboxEditor::ModernViewportCameraControllerRequestBus::Event(
|
||||
viewportContext->GetId(), &SandboxEditor::ModernViewportCameraControllerRequestBus::Events::InterpolateToTransform,
|
||||
nextCameraTransform);
|
||||
AtomToolsFramework::ModularViewportCameraControllerRequestBus::Event(
|
||||
viewportContext->GetId(),
|
||||
&AtomToolsFramework::ModularViewportCameraControllerRequestBus::Events::InterpolateToTransform, nextCameraTransform);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2026,678 +2036,6 @@ void SandboxIntegrationManager::BrowseForAssets(AssetSelectionModel& selection)
|
||||
AssetBrowserComponentRequestBus::Broadcast(&AssetBrowserComponentRequests::PickAssets, selection, GetMainWindow());
|
||||
}
|
||||
|
||||
void SandboxIntegrationManager::SetColor(float r, float g, float b, float a)
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
m_dc->SetColor(Vec3(r, g, b), a);
|
||||
}
|
||||
}
|
||||
|
||||
void SandboxIntegrationManager::SetColor(const AZ::Color& color)
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
m_dc->SetColor(AZColorToLYColorF(color));
|
||||
}
|
||||
}
|
||||
|
||||
void SandboxIntegrationManager::SetColor(const AZ::Vector4& color)
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
m_dc->SetColor(AZVec3ToLYVec3(color.GetAsVector3()), color.GetW());
|
||||
}
|
||||
}
|
||||
|
||||
void SandboxIntegrationManager::SetAlpha(float a)
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
m_dc->SetAlpha(a);
|
||||
}
|
||||
}
|
||||
|
||||
void SandboxIntegrationManager::DrawQuad(const AZ::Vector3& p1, const AZ::Vector3& p2, const AZ::Vector3& p3, const AZ::Vector3& p4)
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
m_dc->DrawQuad(
|
||||
AZVec3ToLYVec3(p1),
|
||||
AZVec3ToLYVec3(p2),
|
||||
AZVec3ToLYVec3(p3),
|
||||
AZVec3ToLYVec3(p4));
|
||||
}
|
||||
}
|
||||
|
||||
void SandboxIntegrationManager::DrawQuad(float width, float height)
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
m_dc->DrawQuad(width, height);
|
||||
}
|
||||
}
|
||||
|
||||
void SandboxIntegrationManager::DrawWireQuad(const AZ::Vector3& p1, const AZ::Vector3& p2, const AZ::Vector3& p3, const AZ::Vector3& p4)
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
m_dc->DrawWireQuad(
|
||||
AZVec3ToLYVec3(p1),
|
||||
AZVec3ToLYVec3(p2),
|
||||
AZVec3ToLYVec3(p3),
|
||||
AZVec3ToLYVec3(p4));
|
||||
}
|
||||
}
|
||||
|
||||
void SandboxIntegrationManager::DrawWireQuad(float width, float height)
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
m_dc->DrawWireQuad(width, height);
|
||||
}
|
||||
}
|
||||
|
||||
void SandboxIntegrationManager::DrawQuadGradient(const AZ::Vector3& p1, const AZ::Vector3& p2, const AZ::Vector3& p3, const AZ::Vector3& p4, const AZ::Vector4& firstColor, const AZ::Vector4& secondColor)
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
m_dc->DrawQuadGradient(
|
||||
AZVec3ToLYVec3(p1),
|
||||
AZVec3ToLYVec3(p2),
|
||||
AZVec3ToLYVec3(p3),
|
||||
AZVec3ToLYVec3(p4),
|
||||
ColorF(AZVec3ToLYVec3(firstColor.GetAsVector3()), firstColor.GetW()),
|
||||
ColorF(AZVec3ToLYVec3(secondColor.GetAsVector3()), secondColor.GetW()));
|
||||
}
|
||||
}
|
||||
|
||||
void SandboxIntegrationManager::DrawTri(const AZ::Vector3& p1, const AZ::Vector3& p2, const AZ::Vector3& p3)
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
m_dc->DrawTri(
|
||||
AZVec3ToLYVec3(p1),
|
||||
AZVec3ToLYVec3(p2),
|
||||
AZVec3ToLYVec3(p3));
|
||||
}
|
||||
}
|
||||
|
||||
void SandboxIntegrationManager::DrawTriangles(const AZStd::vector<AZ::Vector3>& vertices, const AZ::Color& color)
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
// transform to world space
|
||||
const auto vecTransform = [this](const AZ::Vector3& vec)
|
||||
{
|
||||
return m_dc->GetMatrix() * AZVec3ToLYVec3(vec);
|
||||
};
|
||||
|
||||
AZStd::vector<Vec3> cryVertices;
|
||||
cryVertices.reserve(vertices.size());
|
||||
AZStd::transform(vertices.begin(), vertices.end(), AZStd::back_inserter(cryVertices), vecTransform);
|
||||
m_dc->DrawTriangles(
|
||||
cryVertices,
|
||||
AZColorToLYColorF(color));
|
||||
}
|
||||
}
|
||||
|
||||
void SandboxIntegrationManager::DrawTrianglesIndexed(const AZStd::vector<AZ::Vector3>& vertices, const AZStd::vector<AZ::u32>& indices, const AZ::Color& color)
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
// transform to world space
|
||||
const auto vecTransform = [this](const AZ::Vector3& vec)
|
||||
{
|
||||
return m_dc->GetMatrix() * AZVec3ToLYVec3(vec);
|
||||
};
|
||||
|
||||
AZStd::vector<Vec3> cryVertices;
|
||||
cryVertices.reserve(vertices.size());
|
||||
AZStd::transform(vertices.begin(), vertices.end(), AZStd::back_inserter(cryVertices), vecTransform);
|
||||
m_dc->DrawTrianglesIndexed(
|
||||
cryVertices,
|
||||
indices,
|
||||
AZColorToLYColorF(color));
|
||||
}
|
||||
}
|
||||
|
||||
void SandboxIntegrationManager::DrawWireBox(const AZ::Vector3& min, const AZ::Vector3& max)
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
m_dc->DrawWireBox(
|
||||
AZVec3ToLYVec3(min),
|
||||
AZVec3ToLYVec3(max));
|
||||
}
|
||||
}
|
||||
|
||||
void SandboxIntegrationManager::DrawSolidBox(const AZ::Vector3& min, const AZ::Vector3& max)
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
m_dc->DrawSolidBox(
|
||||
AZVec3ToLYVec3(min),
|
||||
AZVec3ToLYVec3(max));
|
||||
}
|
||||
}
|
||||
|
||||
void SandboxIntegrationManager::DrawSolidOBB(const AZ::Vector3& center, const AZ::Vector3& axisX, const AZ::Vector3& axisY, const AZ::Vector3& axisZ, const AZ::Vector3& halfExtents)
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
m_dc->DrawSolidOBB(AZVec3ToLYVec3(center), AZVec3ToLYVec3(axisX), AZVec3ToLYVec3(axisY), AZVec3ToLYVec3(axisZ), AZVec3ToLYVec3(halfExtents));
|
||||
}
|
||||
}
|
||||
|
||||
void SandboxIntegrationManager::DrawPoint(const AZ::Vector3& p, int nSize)
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
m_dc->DrawPoint(AZVec3ToLYVec3(p), nSize);
|
||||
}
|
||||
}
|
||||
|
||||
void SandboxIntegrationManager::DrawLine(const AZ::Vector3& p1, const AZ::Vector3& p2)
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
m_dc->DrawLine(
|
||||
AZVec3ToLYVec3(p1),
|
||||
AZVec3ToLYVec3(p2));
|
||||
}
|
||||
}
|
||||
|
||||
void SandboxIntegrationManager::DrawLine(const AZ::Vector3& p1, const AZ::Vector3& p2, const AZ::Vector4& col1, const AZ::Vector4& col2)
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
m_dc->DrawLine(
|
||||
AZVec3ToLYVec3(p1),
|
||||
AZVec3ToLYVec3(p2),
|
||||
ColorF(AZVec3ToLYVec3(col1.GetAsVector3()), col1.GetW()),
|
||||
ColorF(AZVec3ToLYVec3(col2.GetAsVector3()), col2.GetW()));
|
||||
}
|
||||
}
|
||||
|
||||
void SandboxIntegrationManager::DrawLines(const AZStd::vector<AZ::Vector3>& lines, const AZ::Color& color)
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
// transform to world space
|
||||
const auto vecTransform = [this](const AZ::Vector3& vec)
|
||||
{
|
||||
return m_dc->GetMatrix() * AZVec3ToLYVec3(vec);
|
||||
};
|
||||
|
||||
AZStd::vector<Vec3> cryLines;
|
||||
cryLines.reserve(cryLines.size());
|
||||
AZStd::transform(lines.begin(), lines.end(), AZStd::back_inserter(cryLines), vecTransform);
|
||||
m_dc->DrawLines(cryLines, AZColorToLYColorF(color));
|
||||
}
|
||||
}
|
||||
|
||||
void SandboxIntegrationManager::DrawPolyLine(const AZ::Vector3* pnts, int numPoints, bool cycled)
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
Vec3* points = new Vec3[numPoints];
|
||||
for (int i = 0; i < numPoints; ++i)
|
||||
{
|
||||
points[i] = AZVec3ToLYVec3(pnts[i]);
|
||||
}
|
||||
|
||||
m_dc->DrawPolyLine(points, numPoints, cycled);
|
||||
|
||||
delete[] points;
|
||||
}
|
||||
}
|
||||
|
||||
void SandboxIntegrationManager::DrawWireQuad2d(const AZ::Vector2& p1, const AZ::Vector2& p2, float z)
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
m_dc->DrawWireQuad2d(
|
||||
QPoint(static_cast<int>(p1.GetX()), static_cast<int>(p1.GetY())),
|
||||
QPoint(static_cast<int>(p2.GetX()), static_cast<int>(p2.GetY())),
|
||||
z);
|
||||
}
|
||||
}
|
||||
|
||||
void SandboxIntegrationManager::DrawLine2d(const AZ::Vector2& p1, const AZ::Vector2& p2, float z)
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
m_dc->DrawLine2d(
|
||||
QPoint(static_cast<int>(p1.GetX()), static_cast<int>(p1.GetY())),
|
||||
QPoint(static_cast<int>(p2.GetX()), static_cast<int>(p2.GetY())),
|
||||
z);
|
||||
}
|
||||
}
|
||||
|
||||
void SandboxIntegrationManager::DrawLine2dGradient(const AZ::Vector2& p1, const AZ::Vector2& p2, float z, const AZ::Vector4& firstColor, const AZ::Vector4& secondColor)
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
m_dc->DrawLine2dGradient(
|
||||
QPoint(static_cast<int>(p1.GetX()), static_cast<int>(p1.GetY())),
|
||||
QPoint(static_cast<int>(p2.GetX()), static_cast<int>(p2.GetY())),
|
||||
z,
|
||||
ColorF(AZVec3ToLYVec3(firstColor.GetAsVector3()), firstColor.GetW()),
|
||||
ColorF(AZVec3ToLYVec3(secondColor.GetAsVector3()), secondColor.GetW()));
|
||||
}
|
||||
}
|
||||
|
||||
void SandboxIntegrationManager::DrawWireCircle2d(const AZ::Vector2& center, float radius, float z)
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
m_dc->DrawWireCircle2d(
|
||||
QPoint(static_cast<int>(center.GetX()), static_cast<int>(center.GetY())),
|
||||
radius, z);
|
||||
}
|
||||
}
|
||||
|
||||
void SandboxIntegrationManager::DrawTerrainCircle(const AZ::Vector3& worldPos, float radius, float height)
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
m_dc->DrawTerrainCircle(
|
||||
AZVec3ToLYVec3(worldPos), radius, height);
|
||||
}
|
||||
}
|
||||
|
||||
void SandboxIntegrationManager::DrawTerrainCircle(const AZ::Vector3& center, float radius, float angle1, float angle2, float height)
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
m_dc->DrawTerrainCircle(
|
||||
AZVec3ToLYVec3(center), radius, angle1, angle2, height);
|
||||
}
|
||||
}
|
||||
|
||||
void SandboxIntegrationManager::DrawArc(const AZ::Vector3& pos, float radius, float startAngleDegrees, float sweepAngleDegrees, float angularStepDegrees, int referenceAxis)
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
m_dc->DrawArc(
|
||||
AZVec3ToLYVec3(pos),
|
||||
radius,
|
||||
startAngleDegrees,
|
||||
sweepAngleDegrees,
|
||||
angularStepDegrees,
|
||||
referenceAxis);
|
||||
}
|
||||
}
|
||||
|
||||
void SandboxIntegrationManager::DrawArc(const AZ::Vector3& pos, float radius, float startAngleDegrees, float sweepAngleDegrees, float angularStepDegrees, const AZ::Vector3& fixedAxis)
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
m_dc->DrawArc(
|
||||
AZVec3ToLYVec3(pos),
|
||||
radius,
|
||||
startAngleDegrees,
|
||||
sweepAngleDegrees,
|
||||
angularStepDegrees,
|
||||
AZVec3ToLYVec3(fixedAxis));
|
||||
}
|
||||
}
|
||||
|
||||
void SandboxIntegrationManager::DrawCircle(const AZ::Vector3& pos, float radius, int nUnchangedAxis)
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
m_dc->DrawCircle(
|
||||
AZVec3ToLYVec3(pos),
|
||||
radius,
|
||||
nUnchangedAxis);
|
||||
}
|
||||
}
|
||||
|
||||
void SandboxIntegrationManager::DrawHalfDottedCircle(const AZ::Vector3& pos, float radius, const AZ::Vector3& viewPos, int nUnchangedAxis)
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
m_dc->DrawHalfDottedCircle(
|
||||
AZVec3ToLYVec3(pos),
|
||||
radius,
|
||||
AZVec3ToLYVec3(viewPos),
|
||||
nUnchangedAxis);
|
||||
}
|
||||
}
|
||||
|
||||
void SandboxIntegrationManager::DrawCone(const AZ::Vector3& pos, const AZ::Vector3& dir, float radius, float height, bool drawShaded)
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
m_dc->DrawCone(
|
||||
AZVec3ToLYVec3(pos),
|
||||
AZVec3ToLYVec3(dir),
|
||||
radius,
|
||||
height,
|
||||
drawShaded);
|
||||
}
|
||||
}
|
||||
|
||||
void SandboxIntegrationManager::DrawWireCylinder(const AZ::Vector3& center, const AZ::Vector3& axis, float radius, float height)
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
m_dc->DrawWireCylinder(
|
||||
AZVec3ToLYVec3(center),
|
||||
AZVec3ToLYVec3(axis),
|
||||
radius,
|
||||
height);
|
||||
}
|
||||
}
|
||||
|
||||
void SandboxIntegrationManager::DrawSolidCylinder(const AZ::Vector3& center, const AZ::Vector3& axis, float radius, float height, bool drawShaded)
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
m_dc->DrawSolidCylinder(
|
||||
AZVec3ToLYVec3(center),
|
||||
AZVec3ToLYVec3(axis),
|
||||
radius,
|
||||
height,
|
||||
drawShaded);
|
||||
}
|
||||
}
|
||||
|
||||
void SandboxIntegrationManager::DrawWireCapsule(const AZ::Vector3& center, const AZ::Vector3& axis, float radius, float height)
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
m_dc->DrawWireCapsule(
|
||||
AZVec3ToLYVec3(center),
|
||||
AZVec3ToLYVec3(axis),
|
||||
radius,
|
||||
height);
|
||||
}
|
||||
}
|
||||
|
||||
void SandboxIntegrationManager::DrawTerrainRect(float x1, float y1, float x2, float y2, float height)
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
m_dc->DrawTerrainRect(x1, y1, x2, y2, height);
|
||||
}
|
||||
}
|
||||
|
||||
void SandboxIntegrationManager::DrawTerrainLine(AZ::Vector3 worldPos1, AZ::Vector3 worldPos2)
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
m_dc->DrawTerrainLine(
|
||||
AZVec3ToLYVec3(worldPos1),
|
||||
AZVec3ToLYVec3(worldPos2));
|
||||
}
|
||||
}
|
||||
|
||||
void SandboxIntegrationManager::DrawWireSphere(const AZ::Vector3& pos, float radius)
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
m_dc->DrawWireSphere(AZVec3ToLYVec3(pos), radius);
|
||||
}
|
||||
}
|
||||
|
||||
void SandboxIntegrationManager::DrawWireSphere(const AZ::Vector3& pos, const AZ::Vector3 radius)
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
m_dc->DrawWireSphere(
|
||||
AZVec3ToLYVec3(pos),
|
||||
AZVec3ToLYVec3(radius));
|
||||
}
|
||||
}
|
||||
|
||||
void SandboxIntegrationManager::DrawWireDisk(const AZ::Vector3& pos, const AZ::Vector3& dir, float radius)
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
m_dc->DrawWireDisk(
|
||||
AZVec3ToLYVec3(pos),
|
||||
AZVec3ToLYVec3(dir),
|
||||
radius);
|
||||
}
|
||||
}
|
||||
|
||||
void SandboxIntegrationManager::DrawBall(const AZ::Vector3& pos, float radius, bool drawShaded)
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
m_dc->DrawBall(AZVec3ToLYVec3(pos), radius, drawShaded);
|
||||
}
|
||||
}
|
||||
|
||||
void SandboxIntegrationManager::DrawDisk(const AZ::Vector3& pos, const AZ::Vector3& dir, float radius)
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
m_dc->DrawDisk(
|
||||
AZVec3ToLYVec3(pos),
|
||||
AZVec3ToLYVec3(dir),
|
||||
radius);
|
||||
}
|
||||
}
|
||||
|
||||
void SandboxIntegrationManager::DrawArrow(const AZ::Vector3& src, const AZ::Vector3& trg, float fHeadScale, bool b2SidedArrow)
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
m_dc->DrawArrow(
|
||||
AZVec3ToLYVec3(src),
|
||||
AZVec3ToLYVec3(trg),
|
||||
fHeadScale,
|
||||
b2SidedArrow);
|
||||
}
|
||||
}
|
||||
|
||||
void SandboxIntegrationManager::DrawTextLabel(const AZ::Vector3& pos, float size, const char* text, const bool bCenter, int srcOffsetX, int srcOffsetY)
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
m_dc->DrawTextLabel(
|
||||
AZVec3ToLYVec3(pos),
|
||||
size,
|
||||
text,
|
||||
bCenter,
|
||||
srcOffsetX,
|
||||
srcOffsetY);
|
||||
}
|
||||
}
|
||||
|
||||
void SandboxIntegrationManager::Draw2dTextLabel(float x, float y, float size, const char* text, bool bCenter)
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
m_dc->Draw2dTextLabel(x, y, size, text, bCenter);
|
||||
}
|
||||
}
|
||||
|
||||
void SandboxIntegrationManager::DrawTextureLabel(ITexture* texture, const AZ::Vector3& pos, float sizeX, float sizeY, int texIconFlags)
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
if (texture)
|
||||
{
|
||||
float textureWidth = aznumeric_caster(texture->GetWidth());
|
||||
float textureHeight = aznumeric_caster(texture->GetHeight());
|
||||
|
||||
// resize the label in proportion to the actual texture size
|
||||
if (textureWidth > textureHeight)
|
||||
{
|
||||
sizeY = sizeX * (textureHeight / textureWidth);
|
||||
}
|
||||
else
|
||||
{
|
||||
sizeX = sizeY * (textureWidth / textureHeight);
|
||||
}
|
||||
|
||||
m_dc->DrawTextureLabel(AZVec3ToLYVec3(pos), sizeX, sizeY, texture->GetTextureID(), texIconFlags);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void SandboxIntegrationManager::DrawTextureLabel(int textureId, const AZ::Vector3& pos, float sizeX, float sizeY, int texIconFlags)
|
||||
{
|
||||
// ToDo: With Atom?
|
||||
AZ_UNUSED(textureId);
|
||||
AZ_UNUSED(pos);
|
||||
AZ_UNUSED(sizeX);
|
||||
AZ_UNUSED(sizeY);
|
||||
AZ_UNUSED(texIconFlags);
|
||||
}
|
||||
|
||||
void SandboxIntegrationManager::SetLineWidth(float width)
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
m_dc->SetLineWidth(width);
|
||||
}
|
||||
}
|
||||
|
||||
bool SandboxIntegrationManager::IsVisible(const AZ::Aabb& bounds)
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
const AABB aabb(
|
||||
AZVec3ToLYVec3(bounds.GetMin()),
|
||||
AZVec3ToLYVec3(bounds.GetMax()));
|
||||
|
||||
return m_dc->IsVisible(aabb);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int SandboxIntegrationManager::SetFillMode(int nFillMode)
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
return m_dc->SetFillMode(nFillMode);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
float SandboxIntegrationManager::GetLineWidth()
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
return m_dc->GetLineWidth();
|
||||
}
|
||||
|
||||
return 0.f;
|
||||
}
|
||||
|
||||
float SandboxIntegrationManager::GetAspectRatio()
|
||||
{
|
||||
if (m_dc && m_dc->GetView())
|
||||
{
|
||||
return m_dc->GetView()->GetAspectRatio();
|
||||
}
|
||||
|
||||
return 0.f;
|
||||
}
|
||||
|
||||
void SandboxIntegrationManager::DepthTestOff()
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
m_dc->DepthTestOff();
|
||||
}
|
||||
}
|
||||
|
||||
void SandboxIntegrationManager::DepthTestOn()
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
m_dc->DepthTestOn();
|
||||
}
|
||||
}
|
||||
|
||||
void SandboxIntegrationManager::DepthWriteOff()
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
m_dc->DepthWriteOff();
|
||||
}
|
||||
}
|
||||
|
||||
void SandboxIntegrationManager::DepthWriteOn()
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
m_dc->DepthWriteOn();
|
||||
}
|
||||
}
|
||||
|
||||
void SandboxIntegrationManager::CullOff()
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
m_dc->CullOff();
|
||||
}
|
||||
}
|
||||
|
||||
void SandboxIntegrationManager::CullOn()
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
m_dc->CullOn();
|
||||
}
|
||||
}
|
||||
|
||||
bool SandboxIntegrationManager::SetDrawInFrontMode(bool bOn)
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
return m_dc->SetDrawInFrontMode(bOn);
|
||||
}
|
||||
|
||||
return 0.f;
|
||||
}
|
||||
|
||||
AZ::u32 SandboxIntegrationManager::GetState()
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
return m_dc->GetState();
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
AZ::u32 SandboxIntegrationManager::SetState(AZ::u32 state)
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
return m_dc->SetState(state);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void SandboxIntegrationManager::PushMatrix(const AZ::Transform& tm)
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
const Matrix34 m = AZTransformToLYTransform(tm);
|
||||
m_dc->PushMatrix(m);
|
||||
}
|
||||
}
|
||||
|
||||
void SandboxIntegrationManager::PopMatrix()
|
||||
{
|
||||
if (m_dc)
|
||||
{
|
||||
m_dc->PopMatrix();
|
||||
}
|
||||
}
|
||||
|
||||
bool SandboxIntegrationManager::DisplayHelpersVisible()
|
||||
{
|
||||
return GetIEditor()->GetDisplaySettings()->IsDisplayHelpers();
|
||||
|
||||
@@ -77,6 +77,7 @@ class CHyperGraph;
|
||||
|
||||
namespace AzToolsFramework
|
||||
{
|
||||
class EditorEntityAPI;
|
||||
class EditorEntityUiInterface;
|
||||
|
||||
namespace AssetBrowser
|
||||
@@ -99,7 +100,6 @@ class SandboxIntegrationManager
|
||||
, private AzToolsFramework::EditorEvents::Bus::Handler
|
||||
, private AzToolsFramework::EditorWindowRequests::Bus::Handler
|
||||
, private AzFramework::AssetCatalogEventBus::Handler
|
||||
, private AzFramework::DebugDisplayRequestBus::Handler
|
||||
, private AzFramework::DisplayContextRequestBus::Handler
|
||||
, private AzToolsFramework::EditorEntityContextNotificationBus::Handler
|
||||
, private AzToolsFramework::SliceEditorEntityOwnershipServiceNotificationBus::Handler
|
||||
@@ -201,70 +201,6 @@ private:
|
||||
const AzFramework::SliceInstantiationTicket& ticket) override;
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// AzToolsFramework::DebugDisplayRequestBus
|
||||
void SetColor(float r, float g, float b, float a) override;
|
||||
void SetColor(const AZ::Color& color) override;
|
||||
void SetColor(const AZ::Vector4& color) override;
|
||||
void SetAlpha(float a) override;
|
||||
void DrawQuad(const AZ::Vector3& p1, const AZ::Vector3& p2, const AZ::Vector3& p3, const AZ::Vector3& p4) override;
|
||||
void DrawQuad(float width, float height) override;
|
||||
void DrawWireQuad(const AZ::Vector3& p1, const AZ::Vector3& p2, const AZ::Vector3& p3, const AZ::Vector3& p4) override;
|
||||
void DrawWireQuad(float width, float height) override;
|
||||
void DrawQuadGradient(const AZ::Vector3& p1, const AZ::Vector3& p2, const AZ::Vector3& p3, const AZ::Vector3& p4, const AZ::Vector4& firstColor, const AZ::Vector4& secondColor) override;
|
||||
void DrawTri(const AZ::Vector3& p1, const AZ::Vector3& p2, const AZ::Vector3& p3) override;
|
||||
void DrawTriangles(const AZStd::vector<AZ::Vector3>& vertices, const AZ::Color& color) override;
|
||||
void DrawTrianglesIndexed(const AZStd::vector<AZ::Vector3>& vertices, const AZStd::vector<AZ::u32>& indices, const AZ::Color& color) override;
|
||||
void DrawWireBox(const AZ::Vector3& min, const AZ::Vector3& max) override;
|
||||
void DrawSolidBox(const AZ::Vector3& min, const AZ::Vector3& max) override;
|
||||
void DrawSolidOBB(const AZ::Vector3& center, const AZ::Vector3& axisX, const AZ::Vector3& axisY, const AZ::Vector3& axisZ, const AZ::Vector3& halfExtents) override;
|
||||
void DrawPoint(const AZ::Vector3& p, int nSize) override;
|
||||
void DrawLine(const AZ::Vector3& p1, const AZ::Vector3& p2) override;
|
||||
void DrawLine(const AZ::Vector3& p1, const AZ::Vector3& p2, const AZ::Vector4& col1, const AZ::Vector4& col2) override;
|
||||
void DrawLines(const AZStd::vector<AZ::Vector3>& lines, const AZ::Color& color) override;
|
||||
void DrawPolyLine(const AZ::Vector3* pnts, int numPoints, bool cycled) override;
|
||||
void DrawWireQuad2d(const AZ::Vector2& p1, const AZ::Vector2& p2, float z) override;
|
||||
void DrawLine2d(const AZ::Vector2& p1, const AZ::Vector2& p2, float z) override;
|
||||
void DrawLine2dGradient(const AZ::Vector2& p1, const AZ::Vector2& p2, float z, const AZ::Vector4& firstColor, const AZ::Vector4& secondColor) override;
|
||||
void DrawWireCircle2d(const AZ::Vector2& center, float radius, float z) override;
|
||||
void DrawTerrainCircle(const AZ::Vector3& worldPos, float radius, float height) override;
|
||||
void DrawTerrainCircle(const AZ::Vector3& center, float radius, float angle1, float angle2, float height) override;
|
||||
void DrawArc(const AZ::Vector3& pos, float radius, float startAngleDegrees, float sweepAngleDegrees, float angularStepDegrees, int referenceAxis) override;
|
||||
void DrawArc(const AZ::Vector3& pos, float radius, float startAngleDegrees, float sweepAngleDegrees, float angularStepDegrees, const AZ::Vector3& fixedAxis) override;
|
||||
void DrawCone(const AZ::Vector3& pos, const AZ::Vector3& dir, float radius, float height, bool drawShaded = true) override;
|
||||
void DrawCircle(const AZ::Vector3& pos, float radius, int nUnchangedAxis) override;
|
||||
void DrawHalfDottedCircle(const AZ::Vector3& pos, float radius, const AZ::Vector3& viewPos, int nUnchangedAxis) override;
|
||||
void DrawWireCylinder(const AZ::Vector3& center, const AZ::Vector3& axis, float radius, float height) override;
|
||||
void DrawSolidCylinder(const AZ::Vector3& center, const AZ::Vector3& axis, float radius, float height, bool drawShaded = true) override;
|
||||
void DrawWireCapsule(const AZ::Vector3& center, const AZ::Vector3& axis, float radius, float height) override;
|
||||
void DrawTerrainRect(float x1, float y1, float x2, float y2, float height) override;
|
||||
void DrawTerrainLine(AZ::Vector3 worldPos1, AZ::Vector3 worldPos2) override;
|
||||
void DrawWireSphere(const AZ::Vector3& pos, float radius) override;
|
||||
void DrawWireSphere(const AZ::Vector3& pos, const AZ::Vector3 radius) override;
|
||||
void DrawWireDisk(const AZ::Vector3& pos, const AZ::Vector3& dir, float radius) override;
|
||||
void DrawBall(const AZ::Vector3& pos, float radius, bool drawShaded = true) override;
|
||||
void DrawDisk(const AZ::Vector3& pos, const AZ::Vector3& dir, float radius) override;
|
||||
void DrawArrow(const AZ::Vector3& src, const AZ::Vector3& trg, float fHeadScale, bool b2SidedArrow) override;
|
||||
void DrawTextLabel(const AZ::Vector3& pos, float size, const char* text, const bool bCenter, int srcOffsetX, int scrOffsetY) override;
|
||||
void Draw2dTextLabel(float x, float y, float size, const char* text, bool bCenter) override;
|
||||
void DrawTextureLabel(ITexture* texture, const AZ::Vector3& pos, float sizeX, float sizeY, int texIconFlags) override;
|
||||
void DrawTextureLabel(int textureId, const AZ::Vector3& pos, float sizeX, float sizeY, int texIconFlags) override;
|
||||
void SetLineWidth(float width) override;
|
||||
bool IsVisible(const AZ::Aabb& bounds) override;
|
||||
int SetFillMode(int nFillMode) override;
|
||||
float GetLineWidth() override;
|
||||
float GetAspectRatio() override;
|
||||
void DepthTestOff() override;
|
||||
void DepthTestOn() override;
|
||||
void DepthWriteOff() override;
|
||||
void DepthWriteOn() override;
|
||||
void CullOff() override;
|
||||
void CullOn() override;
|
||||
bool SetDrawInFrontMode(bool bOn) override;
|
||||
AZ::u32 GetState() override;
|
||||
AZ::u32 SetState(AZ::u32 state) override;
|
||||
void PushMatrix(const AZ::Transform& tm) override;
|
||||
void PopMatrix() override;
|
||||
|
||||
// AzFramework::DisplayContextRequestBus (and @deprecated EntityDebugDisplayRequestBus)
|
||||
// AzFramework::DisplayContextRequestBus
|
||||
void SetDC(DisplayContext* dc) override;
|
||||
@@ -371,6 +307,7 @@ private:
|
||||
|
||||
AzToolsFramework::EditorEntityUiInterface* m_editorEntityUiInterface = nullptr;
|
||||
AzToolsFramework::Prefab::PrefabIntegrationInterface* m_prefabIntegrationInterface = nullptr;
|
||||
AzToolsFramework::EditorEntityAPI* m_editorEntityAPI = nullptr;
|
||||
|
||||
// Overrides UI styling and behavior for Layer Entities
|
||||
AzToolsFramework::LayerUiHandler m_layerUiOverrideHandler;
|
||||
|
||||
@@ -65,6 +65,7 @@
|
||||
#include "OutlinerTreeView.hxx"
|
||||
#include "Include/ICommandManager.h"
|
||||
#include "Include/IObjectManager.h"
|
||||
#include "OutlinerCacheBus.h"
|
||||
|
||||
#include <Editor/CryEditDoc.h>
|
||||
#include <AzCore/Outcome/Outcome.h>
|
||||
@@ -1538,6 +1539,16 @@ void OutlinerListModel::OnEntityInfoUpdatedName(AZ::EntityId entityId, const AZS
|
||||
{
|
||||
(void)name;
|
||||
QueueEntityUpdate(entityId);
|
||||
|
||||
bool isSelected = false;
|
||||
AzToolsFramework::ToolsApplicationRequests::Bus::BroadcastResult(
|
||||
isSelected, &AzToolsFramework::ToolsApplicationRequests::IsSelected, entityId);
|
||||
|
||||
if (isSelected)
|
||||
{
|
||||
// Ask the system to scroll to the entity in case it is off screen after the rename
|
||||
OutlinerModelNotificationBus::Broadcast(&OutlinerModelNotifications::QueueScrollToNewContent, entityId);
|
||||
}
|
||||
}
|
||||
|
||||
void OutlinerListModel::OnEntityInfoUpdatedUnsavedChanges(AZ::EntityId entityId)
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
#include <AssetImporterPlugin.h>
|
||||
#include <AssetImporterWindow.h>
|
||||
#include <QtViewPaneManager.h>
|
||||
#include <SceneAPI/SceneCore/Events/AssetImportRequest.h>
|
||||
#include <SceneAPI/SceneCore/Utilities/Reporting.h>
|
||||
#include <LyViewPaneNames.h>
|
||||
#include <AzToolsFramework/API/ToolsApplicationAPI.h>
|
||||
@@ -37,6 +38,10 @@ AssetImporterPlugin::AssetImporterPlugin(IEditor* editor)
|
||||
opt.showInMenu = false; // this view pane is used to display scene settings, but the user never opens it directly through the Tools menu
|
||||
opt.saveKeyName = "Scene Settings (PREVIEW)"; // user settings for this pane were originally saved with PREVIEW, so ensure that's how they are loaded as well, even after the PREVIEW is removed from the name
|
||||
AzToolsFramework::RegisterViewPane<AssetImporterWindow>(m_toolName.c_str(), LyViewPane::CategoryTools, opt);
|
||||
|
||||
AzToolsFramework::ToolsApplicationRequestBus::Broadcast(
|
||||
&AzToolsFramework::ToolsApplicationRequests::CreateAndAddEntityFromComponentTags,
|
||||
AZStd::vector<AZ::Crc32>({ AZ::SceneAPI::Events::AssetImportRequest::GetAssetImportRequestComponentTag() }), "AssetImportersEntity");
|
||||
}
|
||||
|
||||
void AssetImporterPlugin::Release()
|
||||
|
||||
Reference in New Issue
Block a user