PR comments/fixes

Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
This commit is contained in:
Esteban Papp
2021-08-25 14:06:26 -07:00
parent b8aab28759
commit 058f6e0f22
15 changed files with 15 additions and 190 deletions
+1 -2
View File
@@ -154,8 +154,7 @@ namespace
}
}
LevelEditorMenuHandler::LevelEditorMenuHandler(
MainWindow* mainWindow, QtViewPaneManager* const viewPaneManager, [[maybe_unused]] QSettings& settings)
LevelEditorMenuHandler::LevelEditorMenuHandler(MainWindow* mainWindow, QtViewPaneManager* const viewPaneManager)
: QObject(mainWindow)
, m_mainWindow(mainWindow)
, m_viewPaneManager(viewPaneManager)
+1 -1
View File
@@ -33,7 +33,7 @@ class LevelEditorMenuHandler
{
Q_OBJECT
public:
LevelEditorMenuHandler(MainWindow* mainWindow, QtViewPaneManager* const viewPaneManager, QSettings& settings);
LevelEditorMenuHandler(MainWindow* mainWindow, QtViewPaneManager* const viewPaneManager);
~LevelEditorMenuHandler();
void Initialize();
@@ -1,74 +0,0 @@
/*
* Copyright (c) Contributors to the Open 3D Engine Project.
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
*
* SPDX-License-Identifier: Apache-2.0 OR MIT
*
*/
// Description : Calculate the reference frame for sub-object selections.
#include "EditorDefs.h"
#include "SubObjectSelectionReferenceFrameCalculator.h"
SubObjectSelectionReferenceFrameCalculator::SubObjectSelectionReferenceFrameCalculator([[maybe_unused]] ESubObjElementType selectionType)
: m_anySelected(false)
, pos(0.0f, 0.0f, 0.0f)
, normal(0.0f, 0.0f, 0.0f)
, nNormals(0)
, bUseExplicitFrame(false)
, bExplicitAnySelected(false)
{
}
void SubObjectSelectionReferenceFrameCalculator::SetExplicitFrame(bool bAnySelected, const Matrix34& refFrame)
{
this->m_refFrame = refFrame;
this->bUseExplicitFrame = true;
this->bExplicitAnySelected = bAnySelected;
}
bool SubObjectSelectionReferenceFrameCalculator::GetFrame(Matrix34& refFrame)
{
if (this->bUseExplicitFrame)
{
refFrame = this->m_refFrame;
return this->bExplicitAnySelected;
}
else
{
refFrame.SetIdentity();
if (this->nNormals > 0)
{
this->normal = this->normal / static_cast<float>(this->nNormals);
if (!this->normal.IsZero())
{
this->normal.Normalize();
}
// Average position.
this->pos = this->pos / static_cast<float>(this->nNormals);
refFrame.SetTranslation(this->pos);
}
if (this->m_anySelected)
{
if (!this->normal.IsZero())
{
Vec3 xAxis(1, 0, 0), yAxis(0, 1, 0), zAxis(0, 0, 1);
if (this->normal.IsEquivalent(zAxis) || normal.IsEquivalent(-zAxis))
{
zAxis = xAxis;
}
xAxis = this->normal.Cross(zAxis).GetNormalized();
yAxis = xAxis.Cross(this->normal).GetNormalized();
refFrame.SetFromVectors(xAxis, yAxis, normal, pos);
}
}
return m_anySelected;
}
}
@@ -1,41 +0,0 @@
/*
* Copyright (c) Contributors to the Open 3D Engine Project.
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
*
* SPDX-License-Identifier: Apache-2.0 OR MIT
*
*/
// Description : Calculate the reference frame for sub-object selections.
#ifndef CRYINCLUDE_EDITOR_EDITMODE_SUBOBJECTSELECTIONREFERENCEFRAMECALCULATOR_H
#define CRYINCLUDE_EDITOR_EDITMODE_SUBOBJECTSELECTIONREFERENCEFRAMECALCULATOR_H
#pragma once
#include "ISubObjectSelectionReferenceFrameCalculator.h"
#include "Objects/SubObjSelection.h"
class SubObjectSelectionReferenceFrameCalculator
: public ISubObjectSelectionReferenceFrameCalculator
{
public:
SubObjectSelectionReferenceFrameCalculator(ESubObjElementType selectionType);
virtual void SetExplicitFrame(bool bAnySelected, const Matrix34& refFrame);
bool GetFrame(Matrix34& refFrame);
private:
bool m_anySelected;
Vec3 pos;
Vec3 normal;
int nNormals;
std::vector<Vec3> positions;
Matrix34 m_refFrame;
bool bUseExplicitFrame;
bool bExplicitAnySelected;
};
#endif // CRYINCLUDE_EDITOR_EDITMODE_SUBOBJECTSELECTIONREFERENCEFRAMECALCULATOR_H
@@ -1,24 +0,0 @@
/*
* Copyright (c) Contributors to the Open 3D Engine Project.
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
*
* SPDX-License-Identifier: Apache-2.0 OR MIT
*
*/
// Description : Calculate the reference frame for sub-object selections.
#ifndef CRYINCLUDE_EDITOR_INCLUDE_ISUBOBJECTSELECTIONREFERENCEFRAMECALCULATOR_H
#define CRYINCLUDE_EDITOR_INCLUDE_ISUBOBJECTSELECTIONREFERENCEFRAMECALCULATOR_H
#pragma once
class ISubObjectSelectionReferenceFrameCalculator
{
public:
virtual void SetExplicitFrame(bool bAnySelected, const Matrix34& refFrame) = 0;
};
#endif // CRYINCLUDE_EDITOR_INCLUDE_ISUBOBJECTSELECTIONREFERENCEFRAMECALCULATOR_H
+1 -1
View File
@@ -297,7 +297,7 @@ MainWindow::MainWindow(QWidget* parent)
, m_settings("O3DE", "O3DE")
, m_toolbarManager(new ToolbarManager(m_actionManager, this))
, m_assetImporterManager(new AssetImporterManager(this))
, m_levelEditorMenuHandler(new LevelEditorMenuHandler(this, m_viewPaneManager, m_settings))
, m_levelEditorMenuHandler(new LevelEditorMenuHandler(this, m_viewPaneManager))
, m_sourceControlNotifHandler(new AzToolsFramework::QtSourceControlNotificationHandler(this))
, m_viewPaneHost(nullptr)
, m_autoSaveTimer(nullptr)
-2
View File
@@ -33,7 +33,6 @@ class CGizmo;
class CObjectArchive;
struct SSubObjSelectionModifyContext;
struct SRayHitInfo;
class ISubObjectSelectionReferenceFrameCalculator;
class CPopupMenuItem;
class QMenu;
struct IRenderNode;
@@ -571,7 +570,6 @@ public:
// Return true if object support selecting of this sub object element type.
virtual bool StartSubObjSelection([[maybe_unused]] int elemType) { return false; };
virtual void EndSubObjectSelection() {};
virtual void CalculateSubObjectSelectionReferenceFrame([[maybe_unused]] ISubObjectSelectionReferenceFrameCalculator* pCalculator) { };
virtual void ModifySubObjSelection([[maybe_unused]] SSubObjSelectionModifyContext& modCtx) {};
virtual void AcceptSubObjectModify() {};
+1 -1
View File
@@ -66,7 +66,7 @@ int main(int argc, char* argv[])
processLaunchInfo.m_environmentVariables = &envVars;
processLaunchInfo.m_showWindow = true;
AzFramework::ProcessWatcher::LaunchProcess(processLaunchInfo, AzFramework::ProcessCommunicationType::COMMUNICATOR_TYPE_NONE);
AZStd::unique_ptr<AzFramework::ProcessWatcher> processWatcher(AzFramework::ProcessWatcher::LaunchProcess(processLaunchInfo, AzFramework::ProcessCommunicationType::COMMUNICATOR_TYPE_NONE));
application.Destroy();
-3
View File
@@ -290,7 +290,6 @@ set(FILES
Include/IPreferencesPage.h
Include/IRenderListener.h
Include/ISourceControl.h
Include/ISubObjectSelectionReferenceFrameCalculator.h
Include/ITextureDatabaseUpdater.h
Include/ITransformManipulator.h
Include/IViewPane.h
@@ -460,8 +459,6 @@ set(FILES
Dialogs/PythonScriptsDialog.ui
Dialogs/Generic/UserOptions.cpp
Dialogs/Generic/UserOptions.h
EditMode/SubObjectSelectionReferenceFrameCalculator.cpp
EditMode/SubObjectSelectionReferenceFrameCalculator.h
Export/ExportManager.cpp
Export/ExportManager.h
Export/OBJExporter.cpp