Merge branch 'main' into jckand/FoundationAuto
This commit is contained in:
@@ -112,7 +112,7 @@ namespace JsonSerializationTests
|
||||
AZ::Transform testTransform = AZ::Transform::CreateIdentity();
|
||||
AZ::Transform expectedTransform =
|
||||
AZ::Transform::CreateFromQuaternion(AZ::Quaternion(0.25f, 0.5f, 0.75f, 1.0f));
|
||||
expectedTransform.SetScale(AZ::Vector3(5.5f));
|
||||
expectedTransform.SetUniformScale(5.5f);
|
||||
|
||||
rapidjson::Document json;
|
||||
json.Parse(R"({ "Rotation": [ 0.25, 0.5, 0.75, 1.0 ], "Scale": 5.5 })");
|
||||
@@ -128,7 +128,7 @@ namespace JsonSerializationTests
|
||||
{
|
||||
AZ::Transform testTransform = AZ::Transform::CreateIdentity();
|
||||
AZ::Transform expectedTransform = AZ::Transform::CreateTranslation(AZ::Vector3(2.25f, 3.5f, 4.75f));
|
||||
expectedTransform.SetScale(AZ::Vector3(5.5f));
|
||||
expectedTransform.SetUniformScale(5.5f);
|
||||
|
||||
rapidjson::Document json;
|
||||
json.Parse(R"({ "Translation": [ 2.25, 3.5, 4.75 ], "Scale": 5.5 })");
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace AzToolsFramework
|
||||
inline AZ::Transform TransformNormalizedScale(const AZ::Transform& transform)
|
||||
{
|
||||
AZ::Transform transformNormalizedScale = transform;
|
||||
transformNormalizedScale.SetScale(AZ::Vector3::CreateOne());
|
||||
transformNormalizedScale.SetUniformScale(1.0f);
|
||||
return transformNormalizedScale;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -2963,7 +2963,7 @@ namespace AzToolsFramework
|
||||
if (transformIt != transformsBefore.end())
|
||||
{
|
||||
AZ::Transform transformBefore = transformIt->second;
|
||||
transformBefore.ExtractScale();
|
||||
transformBefore.ExtractUniformScale();
|
||||
AZ::Transform newWorldFromLocal = transformBefore * scaleTransform;
|
||||
|
||||
SetEntityWorldTransform(entityId, newWorldFromLocal);
|
||||
|
||||
@@ -15,5 +15,7 @@
|
||||
<file>ArrowDownLine.svg</file>
|
||||
<file>ArrowUpLine.svg</file>
|
||||
<file>Backgrounds/FirstTimeBackgroundImage.jpg</file>
|
||||
<file>ArrowDownLine.svg</file>
|
||||
<file>ArrowUpLine.svg</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
* 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 <AzQtComponents/Components/SearchLineEdit.h>
|
||||
#include <GemCatalog/GemCatalogHeaderWidget.h>
|
||||
#include <QHBoxLayout>
|
||||
#include <QLabel>
|
||||
|
||||
namespace O3DE::ProjectManager
|
||||
{
|
||||
GemCatalogHeaderWidget::GemCatalogHeaderWidget(GemSortFilterProxyModel* filterProxyModel, QWidget* parent)
|
||||
: QFrame(parent)
|
||||
{
|
||||
QHBoxLayout* hLayout = new QHBoxLayout();
|
||||
hLayout->setAlignment(Qt::AlignLeft);
|
||||
hLayout->setMargin(0);
|
||||
setLayout(hLayout);
|
||||
|
||||
setStyleSheet("background-color: #1E252F;");
|
||||
|
||||
QLabel* titleLabel = new QLabel(tr("Gem Catalog"));
|
||||
titleLabel->setStyleSheet("font-size: 21px;");
|
||||
hLayout->addWidget(titleLabel);
|
||||
|
||||
hLayout->addSpacerItem(new QSpacerItem(0, 0, QSizePolicy::Expanding));
|
||||
|
||||
AzQtComponents::SearchLineEdit* filterLineEdit = new AzQtComponents::SearchLineEdit();
|
||||
filterLineEdit->setStyleSheet("background-color: #DDDDDD;");
|
||||
connect(filterLineEdit, &QLineEdit::textChanged, this, [=](const QString& text)
|
||||
{
|
||||
filterProxyModel->SetSearchString(text);
|
||||
});
|
||||
hLayout->addWidget(filterLineEdit);
|
||||
|
||||
hLayout->addSpacerItem(new QSpacerItem(0, 0, QSizePolicy::Expanding));
|
||||
hLayout->addSpacerItem(new QSpacerItem(220, 0, QSizePolicy::Fixed));
|
||||
|
||||
setFixedHeight(60);
|
||||
}
|
||||
} // namespace O3DE::ProjectManager
|
||||
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* 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
|
||||
|
||||
#if !defined(Q_MOC_RUN)
|
||||
#include <GemCatalog/GemSortFilterProxyModel.h>
|
||||
#include <QFrame>
|
||||
#endif
|
||||
|
||||
namespace O3DE::ProjectManager
|
||||
{
|
||||
class GemCatalogHeaderWidget
|
||||
: public QFrame
|
||||
{
|
||||
Q_OBJECT // AUTOMOC
|
||||
|
||||
public:
|
||||
explicit GemCatalogHeaderWidget(GemSortFilterProxyModel* filterProxyModel, QWidget* parent = nullptr);
|
||||
~GemCatalogHeaderWidget() = default;
|
||||
};
|
||||
} // namespace O3DE::ProjectManager
|
||||
@@ -12,6 +12,8 @@
|
||||
|
||||
#include <GemCatalog/GemCatalogScreen.h>
|
||||
#include <PythonBindingsInterface.h>
|
||||
#include <GemCatalog/GemCatalogHeaderWidget.h>
|
||||
#include <GemCatalog/GemListHeaderWidget.h>
|
||||
#include <GemCatalog/GemSortFilterProxyModel.h>
|
||||
#include <GemCatalog/GemFilterWidget.h>
|
||||
#include <QVBoxLayout>
|
||||
@@ -34,6 +36,9 @@ namespace O3DE::ProjectManager
|
||||
vLayout->setSpacing(0);
|
||||
setLayout(vLayout);
|
||||
|
||||
GemCatalogHeaderWidget* headerWidget = new GemCatalogHeaderWidget(proxyModel);
|
||||
vLayout->addWidget(headerWidget);
|
||||
|
||||
QHBoxLayout* hLayout = new QHBoxLayout();
|
||||
hLayout->setMargin(0);
|
||||
vLayout->addLayout(hLayout);
|
||||
@@ -64,9 +69,12 @@ namespace O3DE::ProjectManager
|
||||
GemFilterWidget* filterWidget = new GemFilterWidget(proxyModel);
|
||||
filterWidget->setFixedWidth(250);
|
||||
|
||||
GemListHeaderWidget* listHeaderWidget = new GemListHeaderWidget(proxyModel);
|
||||
|
||||
QVBoxLayout* middleVLayout = new QVBoxLayout();
|
||||
middleVLayout->setMargin(0);
|
||||
middleVLayout->setSpacing(0);
|
||||
middleVLayout->addWidget(listHeaderWidget);
|
||||
middleVLayout->addWidget(m_gemListView);
|
||||
|
||||
hLayout->addWidget(filterWidget);
|
||||
|
||||
@@ -124,12 +124,12 @@ namespace O3DE::ProjectManager
|
||||
{
|
||||
if (m_collapseButton->isChecked())
|
||||
{
|
||||
m_collapseButton->setIcon(QIcon(":/Resources/ArrowDownLine.svg"));
|
||||
m_collapseButton->setIcon(QIcon(":/ArrowDownLine.svg"));
|
||||
m_mainWidget->hide();
|
||||
}
|
||||
else
|
||||
{
|
||||
m_collapseButton->setIcon(QIcon(":/Resources/ArrowUpLine.svg"));
|
||||
m_collapseButton->setIcon(QIcon(":/ArrowUpLine.svg"));
|
||||
m_mainWidget->show();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,20 +62,20 @@ namespace O3DE::ProjectManager
|
||||
bool IsValid() const;
|
||||
|
||||
QString m_path;
|
||||
QString m_name;
|
||||
QString m_displayName;
|
||||
QString m_name = "Unknown Gem Name";
|
||||
QString m_displayName = "Unknown Gem Name";
|
||||
AZ::Uuid m_uuid;
|
||||
QString m_creator;
|
||||
QString m_creator = "Unknown Creator";
|
||||
GemOrigin m_gemOrigin = Local;
|
||||
bool m_isAdded = false; //! Is the gem currently added and enabled in the project?
|
||||
QString m_summary;
|
||||
QString m_summary = "No summary provided.";
|
||||
Platforms m_platforms;
|
||||
Types m_types; //! Asset and/or Code and/or Tool
|
||||
QStringList m_features;
|
||||
QString m_directoryLink;
|
||||
QString m_documentationLink;
|
||||
QString m_version;
|
||||
QString m_lastUpdatedDate;
|
||||
QString m_version = "Unknown Version";
|
||||
QString m_lastUpdatedDate = "Unknown Date";
|
||||
int m_binarySizeInKB = 0;
|
||||
QStringList m_dependingGemUuids;
|
||||
QStringList m_conflictingGemUuids;
|
||||
|
||||
@@ -0,0 +1,78 @@
|
||||
/*
|
||||
* 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 <GemCatalog/GemItemDelegate.h>
|
||||
#include <GemCatalog/GemListHeaderWidget.h>
|
||||
#include <QStandardItemModel>
|
||||
#include <QLabel>
|
||||
#include <QVBoxLayout>
|
||||
|
||||
namespace O3DE::ProjectManager
|
||||
{
|
||||
GemListHeaderWidget::GemListHeaderWidget(GemSortFilterProxyModel* proxyModel, QWidget* parent)
|
||||
: QFrame(parent)
|
||||
{
|
||||
QVBoxLayout* vLayout = new QVBoxLayout();
|
||||
vLayout->setMargin(0);
|
||||
setLayout(vLayout);
|
||||
|
||||
setStyleSheet("background-color: #333333;");
|
||||
|
||||
vLayout->addSpacing(20);
|
||||
|
||||
// Top section
|
||||
QHBoxLayout* topLayout = new QHBoxLayout();
|
||||
topLayout->setMargin(0);
|
||||
topLayout->addSpacerItem(new QSpacerItem(0, 0, QSizePolicy::Expanding));
|
||||
|
||||
QLabel* showCountLabel = new QLabel();
|
||||
showCountLabel->setStyleSheet("font-size: 11pt; font: italic;");
|
||||
topLayout->addWidget(showCountLabel);
|
||||
connect(proxyModel, &GemSortFilterProxyModel::OnInvalidated, this, [=]
|
||||
{
|
||||
const int numGemsShown = proxyModel->rowCount();
|
||||
showCountLabel->setText(QString(tr("showing %1 Gems")).arg(numGemsShown));
|
||||
});
|
||||
|
||||
topLayout->addSpacing(GemItemDelegate::s_contentMargins.right() + GemItemDelegate::s_borderWidth);
|
||||
|
||||
vLayout->addLayout(topLayout);
|
||||
|
||||
vLayout->addSpacing(20);
|
||||
|
||||
// Separating line
|
||||
QFrame* hLine = new QFrame();
|
||||
hLine->setFrameShape(QFrame::HLine);
|
||||
hLine->setStyleSheet("color: #666666;");
|
||||
vLayout->addWidget(hLine);
|
||||
|
||||
vLayout->addSpacing(GemItemDelegate::s_contentMargins.top());
|
||||
|
||||
// Bottom section
|
||||
QHBoxLayout* columnHeaderLayout = new QHBoxLayout();
|
||||
columnHeaderLayout->setAlignment(Qt::AlignLeft);
|
||||
|
||||
columnHeaderLayout->addSpacing(31);
|
||||
|
||||
QLabel* gemNameLabel = new QLabel(tr("Gem Name"));
|
||||
gemNameLabel->setStyleSheet("font-size: 11pt;");
|
||||
columnHeaderLayout->addWidget(gemNameLabel);
|
||||
|
||||
columnHeaderLayout->addSpacing(111);
|
||||
|
||||
QLabel* gemSummaryLabel = new QLabel(tr("Gem Summary"));
|
||||
gemSummaryLabel->setStyleSheet("font-size: 11pt;");
|
||||
columnHeaderLayout->addWidget(gemSummaryLabel);
|
||||
|
||||
vLayout->addLayout(columnHeaderLayout);
|
||||
}
|
||||
} // namespace O3DE::ProjectManager
|
||||
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* 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
|
||||
|
||||
#if !defined(Q_MOC_RUN)
|
||||
#include <GemCatalog/GemSortFilterProxyModel.h>
|
||||
#include <QAbstractItemModel>
|
||||
#include <QItemSelectionModel>
|
||||
#include <QFrame>
|
||||
#endif
|
||||
|
||||
namespace O3DE::ProjectManager
|
||||
{
|
||||
class GemListHeaderWidget
|
||||
: public QFrame
|
||||
{
|
||||
Q_OBJECT // AUTOMOC
|
||||
|
||||
public:
|
||||
explicit GemListHeaderWidget(GemSortFilterProxyModel* proxyModel, QWidget* parent = nullptr);
|
||||
~GemListHeaderWidget() = default;
|
||||
};
|
||||
} // namespace O3DE::ProjectManager
|
||||
@@ -58,6 +58,8 @@ set(FILES
|
||||
Source/LinkWidget.cpp
|
||||
Source/TagWidget.h
|
||||
Source/TagWidget.cpp
|
||||
Source/GemCatalog/GemCatalogHeaderWidget.h
|
||||
Source/GemCatalog/GemCatalogHeaderWidget.cpp
|
||||
Source/GemCatalog/GemCatalogScreen.h
|
||||
Source/GemCatalog/GemCatalogScreen.cpp
|
||||
Source/GemCatalog/GemFilterWidget.h
|
||||
@@ -70,6 +72,8 @@ set(FILES
|
||||
Source/GemCatalog/GemItemDelegate.cpp
|
||||
Source/GemCatalog/GemListView.h
|
||||
Source/GemCatalog/GemListView.cpp
|
||||
Source/GemCatalog/GemListHeaderWidget.h
|
||||
Source/GemCatalog/GemListHeaderWidget.cpp
|
||||
Source/GemCatalog/GemModel.h
|
||||
Source/GemCatalog/GemModel.cpp
|
||||
Source/GemCatalog/GemSortFilterProxyModel.h
|
||||
|
||||
@@ -886,7 +886,7 @@ namespace AZ
|
||||
}
|
||||
|
||||
RHI::Ptr<RHI::PipelineLayoutDescriptor> BuildPipelineLayoutDescriptorForApi(
|
||||
const char* builderName, const RPI::ShaderResourceGroupLayoutList& srgLayoutList, const MapOfStringToStageType& shaderEntryPoints,
|
||||
[[maybe_unused]] const char* builderName, const RPI::ShaderResourceGroupLayoutList& srgLayoutList, const MapOfStringToStageType& shaderEntryPoints,
|
||||
const RHI::ShaderCompilerArguments& shaderCompilerArguments, const RootConstantData& rootConstantData,
|
||||
RHI::ShaderPlatformInterface* shaderPlatformInterface, BindingDependencies& bindingDependencies /*inout*/)
|
||||
{
|
||||
|
||||
@@ -318,7 +318,7 @@ namespace AZ
|
||||
{
|
||||
AZ::Transform meshTransform = transformFeatureProcessor->GetTransformForId(TransformServiceFeatureProcessorInterface::ObjectId(mesh.first));
|
||||
AZ::Transform noScaleTransform = meshTransform;
|
||||
noScaleTransform.ExtractScale();
|
||||
noScaleTransform.ExtractUniformScale();
|
||||
AZ::Matrix3x3 rotationMatrix = Matrix3x3::CreateFromTransform(noScaleTransform);
|
||||
rotationMatrix = rotationMatrix.GetInverseFull().GetTranspose();
|
||||
|
||||
|
||||
+1
-1
@@ -231,7 +231,7 @@ namespace AZ
|
||||
AZ_Error("TransformServiceFeatureProcessor", id.IsValid(), "Attempting to get the transform for an invalid handle.");
|
||||
AZ::Matrix3x4 matrix3x4 = AZ::Matrix3x4::CreateFromRowMajorFloat12(m_objectToWorldTransforms.at(id.GetIndex()).m_transform);
|
||||
AZ::Transform transform = AZ::Transform::CreateFromMatrix3x4(matrix3x4);
|
||||
transform.ExtractScale();
|
||||
transform.ExtractUniformScale();
|
||||
return transform;
|
||||
}
|
||||
|
||||
|
||||
@@ -243,14 +243,14 @@ namespace AZ
|
||||
{
|
||||
// apply offset in world-space
|
||||
finalTransform = m_targetEntityTransform * m_targetBoneTransform;
|
||||
finalTransform.SetScale(AZ::Vector3::CreateOne());
|
||||
finalTransform.SetUniformScale(1.0f);
|
||||
finalTransform *= m_targetOffset;
|
||||
}
|
||||
else if (m_scaleSource == AttachmentConfiguration::ScaleSource::TargetEntityScale)
|
||||
{
|
||||
// apply offset in target-entity-space (ignoring bone scale)
|
||||
AZ::Transform boneNoScale = m_targetBoneTransform;
|
||||
boneNoScale.SetScale(AZ::Vector3::CreateOne());
|
||||
boneNoScale.SetUniformScale(1.0f);
|
||||
|
||||
finalTransform = m_targetEntityTransform * boneNoScale * m_targetOffset;
|
||||
}
|
||||
|
||||
+4
-4
@@ -35,7 +35,7 @@ namespace AZ
|
||||
// This equation is based off of the integration of a line segment against a perpendicular normal pointing at the center of the
|
||||
// line segment from some distance away.
|
||||
|
||||
float scale = GetTransform().GetScale().GetMaxElement();
|
||||
float scale = GetTransform().GetUniformScale();
|
||||
float h = GetInteriorHeight() * scale;
|
||||
float t2 = lightThreshold * lightThreshold;
|
||||
float h2 = h * h;
|
||||
@@ -54,7 +54,7 @@ namespace AZ
|
||||
const auto endpoints = m_shapeBus->GetCapsulePoints();
|
||||
GetFeatureProcessor()->SetCapsuleLineSegment(GetLightHandle(), endpoints.m_begin, endpoints.m_end);
|
||||
|
||||
float scale = GetTransform().GetScale().GetMaxElement();
|
||||
float scale = GetTransform().GetUniformScale();
|
||||
float radius = m_shapeBus->GetRadius();
|
||||
GetFeatureProcessor()->SetCapsuleRadius(GetLightHandle(), scale * radius);
|
||||
}
|
||||
@@ -62,7 +62,7 @@ namespace AZ
|
||||
|
||||
float CapsuleLightDelegate::GetSurfaceArea() const
|
||||
{
|
||||
float scale = GetTransform().GetScale().GetMaxElement();
|
||||
float scale = GetTransform().GetUniformScale();
|
||||
float radius = m_shapeBus->GetRadius();
|
||||
float capsArea = 4.0f * Constants::Pi * radius * radius; // both caps make a sphere
|
||||
float sideArea = 2.0f * Constants::Pi * radius * GetInteriorHeight(); // cylindrical area of capsule
|
||||
@@ -77,7 +77,7 @@ namespace AZ
|
||||
float radius = CalculateAttenuationRadius(AreaLightComponentConfig::CutoffIntensity);
|
||||
|
||||
// Add on the caps for the attenuation radius
|
||||
float scale = GetTransform().GetScale().GetMaxElement();
|
||||
float scale = GetTransform().GetUniformScale();
|
||||
float height = m_shapeBus->GetHeight() * scale;
|
||||
|
||||
debugDisplay.SetColor(color);
|
||||
|
||||
@@ -48,7 +48,7 @@ namespace AZ::Render
|
||||
|
||||
float DiskLightDelegate::GetRadius() const
|
||||
{
|
||||
return m_shapeBus->GetRadius() * GetTransform().GetScale().GetMaxElement();
|
||||
return m_shapeBus->GetRadius() * GetTransform().GetUniformScale();
|
||||
}
|
||||
|
||||
void DiskLightDelegate::DrawDebugDisplay(const Transform& transform, const Color& /*color*/, AzFramework::DebugDisplayRequests& debugDisplay, bool isSelected) const
|
||||
|
||||
+1
-1
@@ -217,7 +217,7 @@ namespace AZ
|
||||
GetEntityId(),
|
||||
&TransformBus::Events::GetWorldTM);
|
||||
|
||||
transform.ExtractScale();
|
||||
transform.ExtractUniformScale();
|
||||
const Vector3 origin = transform.GetTranslation();
|
||||
const Vector3 originOffset = origin - (transform.TransformVector(forward) * arrowOffset);
|
||||
const Vector3 target = origin - (transform.TransformVector(forward) * (arrowLength + arrowOffset));
|
||||
|
||||
+1
-1
@@ -73,7 +73,7 @@ namespace AZ
|
||||
twiceArea += vertices.at(i).GetX() * vertices.at(j).GetY();
|
||||
twiceArea -= vertices.at(i).GetY() * vertices.at(j).GetX();
|
||||
}
|
||||
float scale = GetTransform().GetScale().GetMaxElement();
|
||||
float scale = GetTransform().GetUniformScale();
|
||||
return GetAbs(twiceArea * 0.5f * scale * scale);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -50,7 +50,7 @@ namespace AZ
|
||||
|
||||
float SphereLightDelegate::GetRadius() const
|
||||
{
|
||||
return m_shapeBus->GetRadius() * GetTransform().GetScale().GetMaxElement();
|
||||
return m_shapeBus->GetRadius() * GetTransform().GetUniformScale();
|
||||
}
|
||||
|
||||
void SphereLightDelegate::DrawDebugDisplay(const Transform& transform, const Color& color, AzFramework::DebugDisplayRequests& debugDisplay, bool isSelected) const
|
||||
|
||||
+1
-1
@@ -228,7 +228,7 @@ namespace AZ
|
||||
|
||||
// remove scale
|
||||
Transform worldNoScale = world;
|
||||
worldNoScale.ExtractScale();
|
||||
worldNoScale.ExtractUniformScale();
|
||||
|
||||
AZ::Matrix3x4 transformMatrix = AZ::Matrix3x4::CreateFromTransform(worldNoScale);
|
||||
transformMatrix.StoreToRowMajorFloat12(matrix);
|
||||
|
||||
+1
-1
@@ -218,7 +218,7 @@ namespace AZ
|
||||
SunPosition PhysicalSkyComponentController::GetSunTransform(const AZ::Transform& world)
|
||||
{
|
||||
Transform worldNoScale = world;
|
||||
worldNoScale.ExtractScale();
|
||||
worldNoScale.ExtractUniformScale();
|
||||
AZ::Vector3 sunPositionAtom = worldNoScale.TransformVector(AZ::Vector3(0, -1, 0)); // transform Sun from default position
|
||||
|
||||
// Convert sun position to Y-up coordinate
|
||||
|
||||
@@ -68,7 +68,7 @@ namespace Blast
|
||||
|
||||
auto transform = AZ::Transform::CreateFromQuaternionAndTranslation(
|
||||
m_bodyConfiguration.m_orientation, m_bodyConfiguration.m_position);
|
||||
transform.MultiplyByScale(AZ::Vector3(m_scale));
|
||||
transform.MultiplyByUniformScale(m_scale);
|
||||
|
||||
AZ::TransformBus::Event(m_entity->GetId(), &AZ::TransformInterface::SetWorldTM, transform);
|
||||
|
||||
|
||||
@@ -202,7 +202,7 @@ namespace Blast
|
||||
if (parentBody)
|
||||
{
|
||||
parentTransform = parentBody->GetTransform();
|
||||
parentTransform.MultiplyByScale(AZ::Vector3(m_initialTransform.GetScale().GetMaxElement()));
|
||||
parentTransform.MultiplyByUniformScale(m_initialTransform.GetUniformScale());
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -254,7 +254,7 @@ namespace Blast
|
||||
actorDesc.m_parentCenterOfMass = transform.GetTranslation();
|
||||
actorDesc.m_parentLinearVelocity = AZ::Vector3::CreateZero();
|
||||
actorDesc.m_bodyConfiguration = configuration;
|
||||
actorDesc.m_scale = transform.GetScale().GetMaxElement();
|
||||
actorDesc.m_scale = transform.GetUniformScale();
|
||||
|
||||
return actorDesc;
|
||||
}
|
||||
|
||||
@@ -203,7 +203,7 @@ namespace LmbrCentral
|
||||
const AZ::Transform& currentTransform, const CapsuleShapeConfig& configuration,
|
||||
[[maybe_unused]] const AZ::Vector3& currentNonUniformScale)
|
||||
{
|
||||
const float entityScale = currentTransform.GetScale().GetMaxElement();
|
||||
const float entityScale = currentTransform.GetUniformScale();
|
||||
m_axisVector = currentTransform.GetBasisZ().GetNormalizedSafe() * entityScale;
|
||||
|
||||
const float internalCylinderHeight = configuration.m_height - configuration.m_radius * 2.0f;
|
||||
|
||||
@@ -273,7 +273,7 @@ namespace LmbrCentral
|
||||
const AZ::Transform& currentTransform, const CylinderShapeConfig& configuration,
|
||||
[[maybe_unused]] const AZ::Vector3& currentNonUniformScale)
|
||||
{
|
||||
const float entityScale = currentTransform.GetScale().GetMaxElement();
|
||||
const float entityScale = currentTransform.GetUniformScale();
|
||||
m_axisVector = currentTransform.GetBasisZ().GetNormalizedSafe() * entityScale;
|
||||
m_baseCenterPoint = currentTransform.GetTranslation() - m_axisVector * (configuration.m_height * 0.5f);
|
||||
m_axisVector = m_axisVector * configuration.m_height;
|
||||
|
||||
@@ -167,7 +167,7 @@ namespace LmbrCentral
|
||||
{
|
||||
m_position = currentTransform.GetTranslation();
|
||||
m_normal = currentTransform.GetBasisZ().GetNormalized();
|
||||
m_radius = configuration.m_radius * currentTransform.GetScale().GetMaxElement();
|
||||
m_radius = configuration.m_radius * currentTransform.GetUniformScale();
|
||||
}
|
||||
|
||||
const DiskShapeConfig& DiskShape::GetDiskConfiguration() const
|
||||
|
||||
@@ -174,6 +174,6 @@ namespace LmbrCentral
|
||||
|
||||
AZ::Vector3 EditorBoxShapeComponent::GetBoxScale()
|
||||
{
|
||||
return AZ::Vector3(m_boxShape.GetCurrentTransform().GetScale().GetMaxElement() * m_boxShape.GetCurrentNonUniformScale());
|
||||
return AZ::Vector3(m_boxShape.GetCurrentTransform().GetUniformScale() * m_boxShape.GetCurrentNonUniformScale());
|
||||
}
|
||||
} // namespace LmbrCentral
|
||||
|
||||
@@ -349,7 +349,7 @@ namespace LmbrCentral
|
||||
const AZ::Vector3& src, const AZ::Vector3& dir, float& distance)
|
||||
{
|
||||
const auto rayIntersectData = IntersectSpline(m_cachedUniformScaleTransform, src, dir, *m_splineCommon.m_spline);
|
||||
distance = rayIntersectData.m_rayDistance * m_cachedUniformScaleTransform.GetScale().GetMaxElement();
|
||||
distance = rayIntersectData.m_rayDistance * m_cachedUniformScaleTransform.GetUniformScale();
|
||||
|
||||
AzFramework::CameraState cameraState;
|
||||
AzToolsFramework::ViewportInteraction::ViewportInteractionRequestBus::EventResult(
|
||||
|
||||
@@ -136,7 +136,7 @@ namespace LmbrCentral
|
||||
[[maybe_unused]] const AZ::Vector3& currentNonUniformScale)
|
||||
{
|
||||
m_position = currentTransform.GetTranslation();
|
||||
m_radius = configuration.m_radius * currentTransform.GetScale().GetMaxElement();
|
||||
m_radius = configuration.m_radius * currentTransform.GetUniformScale();
|
||||
}
|
||||
|
||||
void DrawSphereShape(
|
||||
|
||||
@@ -685,7 +685,7 @@ namespace PhysX
|
||||
// Let each collider decide how to scale itself, so extract the scale here.
|
||||
AZ::Transform entityWorldTransformWithoutScale = AZ::Transform::CreateIdentity();
|
||||
AZ::TransformBus::EventResult(entityWorldTransformWithoutScale, m_entityId, &AZ::TransformInterface::GetWorldTM);
|
||||
entityWorldTransformWithoutScale.ExtractScale();
|
||||
entityWorldTransformWithoutScale.ExtractUniformScale();
|
||||
|
||||
auto* physXDebug = AZ::Interface<Debug::PhysXDebugInterface>::Get();
|
||||
if (physXDebug == nullptr)
|
||||
|
||||
@@ -89,7 +89,7 @@ namespace PhysX
|
||||
AZ::Transform worldTransform = AZ::Transform::CreateIdentity();
|
||||
AZ::TransformBus::EventResult(
|
||||
worldTransform, m_entityComponentId.GetEntityId(), &AZ::TransformInterface::GetWorldTM);
|
||||
worldTransform.ExtractScale();
|
||||
worldTransform.ExtractUniformScale();
|
||||
|
||||
AZ::Transform localTransform = AZ::Transform::CreateIdentity();
|
||||
EditorJointRequestBus::EventResult(
|
||||
|
||||
@@ -603,7 +603,7 @@ namespace PhysX
|
||||
}
|
||||
|
||||
AZ::Transform colliderTransform = GetWorldTM();
|
||||
colliderTransform.ExtractScale();
|
||||
colliderTransform.ExtractUniformScale();
|
||||
AzPhysics::StaticRigidBodyConfiguration configuration;
|
||||
configuration.m_orientation = colliderTransform.GetRotation();
|
||||
configuration.m_position = colliderTransform.GetTranslation();
|
||||
|
||||
@@ -365,7 +365,7 @@ namespace PhysX
|
||||
}
|
||||
|
||||
AZ::Transform colliderTransform = GetWorldTM();
|
||||
colliderTransform.ExtractScale();
|
||||
colliderTransform.ExtractUniformScale();
|
||||
|
||||
AzPhysics::RigidBodyConfiguration configuration = m_config;
|
||||
configuration.m_orientation = colliderTransform.GetRotation();
|
||||
|
||||
@@ -205,7 +205,7 @@ namespace PhysX
|
||||
}
|
||||
|
||||
AZ::Transform transform = GetWorldTM();
|
||||
transform.ExtractScale();
|
||||
transform.ExtractUniformScale();
|
||||
const size_t numPoints = m_geometryCache.m_cachedSamplePoints.size();
|
||||
for (size_t pointIndex = 0; pointIndex < numPoints; ++pointIndex)
|
||||
{
|
||||
|
||||
@@ -196,7 +196,7 @@ namespace PhysX
|
||||
AZ::Transform::CreateFromQuaternionAndTranslation(colliderConfiguration.m_rotation, colliderConfiguration.m_position);
|
||||
|
||||
AZ::Transform shapeTransform = *m_transform;
|
||||
shapeTransform.ExtractScale();
|
||||
shapeTransform.ExtractUniformScale();
|
||||
|
||||
shapeTransform = existingTransform * shapeTransform;
|
||||
|
||||
|
||||
@@ -718,7 +718,7 @@ namespace PhysX
|
||||
const float boundsInflationFactor = 1.0f;
|
||||
AZ::Transform overallTransformNoScale = GetColliderWorldTransform(worldTransform,
|
||||
colliderConfiguration.m_position, colliderConfiguration.m_rotation);
|
||||
overallTransformNoScale.ExtractScale();
|
||||
overallTransformNoScale.ExtractUniformScale();
|
||||
const physx::PxBounds3 bounds = physx::PxGeometryQuery::getWorldBounds(geometryHolder.any(),
|
||||
PxMathConvert(overallTransformNoScale),
|
||||
boundsInflationFactor);
|
||||
@@ -1378,7 +1378,7 @@ namespace PhysX
|
||||
AZ::TransformBus::EventResult(worldTransformWithoutScale
|
||||
, entityId
|
||||
, &AZ::TransformInterface::GetWorldTM);
|
||||
worldTransformWithoutScale.ExtractScale();
|
||||
worldTransformWithoutScale.ExtractUniformScale();
|
||||
return worldTransformWithoutScale;
|
||||
}
|
||||
|
||||
@@ -1386,10 +1386,10 @@ namespace PhysX
|
||||
const AZ::Transform& entityWorldTransform)
|
||||
{
|
||||
AZ::Transform jointWorldTransformWithoutScale = jointWorldTransform;
|
||||
jointWorldTransformWithoutScale.ExtractScale();
|
||||
jointWorldTransformWithoutScale.ExtractUniformScale();
|
||||
|
||||
AZ::Transform entityWorldTransformWithoutScale = entityWorldTransform;
|
||||
entityWorldTransformWithoutScale.ExtractScale();
|
||||
entityWorldTransformWithoutScale.ExtractUniformScale();
|
||||
AZ::Transform entityWorldTransformInverse = entityWorldTransformWithoutScale.GetInverse();
|
||||
|
||||
return entityWorldTransformInverse * jointWorldTransformWithoutScale;
|
||||
@@ -1399,10 +1399,10 @@ namespace PhysX
|
||||
const AZ::Transform& entityWorldTransform)
|
||||
{
|
||||
AZ::Transform jointLocalTransformWithoutScale = jointLocalTransform;
|
||||
jointLocalTransformWithoutScale.ExtractScale();
|
||||
jointLocalTransformWithoutScale.ExtractUniformScale();
|
||||
|
||||
AZ::Transform entityWorldTransformWithoutScale = entityWorldTransform;
|
||||
entityWorldTransformWithoutScale.ExtractScale();
|
||||
entityWorldTransformWithoutScale.ExtractUniformScale();
|
||||
|
||||
return entityWorldTransformWithoutScale * jointLocalTransformWithoutScale;
|
||||
}
|
||||
|
||||
@@ -309,7 +309,7 @@ namespace Vegetation
|
||||
|
||||
// Create a Transform that represents our instance.
|
||||
AZ::Transform world = AZ::Transform::CreateFromQuaternionAndTranslation(instanceData.m_alignment * instanceData.m_rotation, instanceData.m_position);
|
||||
world.MultiplyByScale(AZ::Vector3(instanceData.m_scale));
|
||||
world.MultiplyByUniformScale(instanceData.m_scale);
|
||||
|
||||
// Request a new dynamic slice instance.
|
||||
AzFramework::SliceInstantiationTicket* ticket = new AzFramework::SliceInstantiationTicket();
|
||||
|
||||
@@ -139,7 +139,7 @@ namespace WhiteBox
|
||||
{
|
||||
const AZ::Transform worldTransformWithoutScale = [worldTransform = world]() mutable
|
||||
{
|
||||
worldTransform.SetScale(AZ::Vector3::CreateOne());
|
||||
worldTransform.SetUniformScale(1.0f);
|
||||
return worldTransform;
|
||||
}();
|
||||
|
||||
|
||||
@@ -73,7 +73,7 @@ namespace WhiteBox
|
||||
const AZ::Transform spaceFromLocal = localFromSpace.GetInverse();
|
||||
const AZ::Vector3 spacePosition = spaceFromLocal.TransformPoint(localPosition);
|
||||
const AZ::Vector3 spaceScaledPosition =
|
||||
AZ::Transform::CreateScale(AZ::Vector3(scale)).TransformPoint(spacePosition);
|
||||
AZ::Transform::CreateUniformScale(scale).TransformPoint(spacePosition);
|
||||
return localFromSpace.TransformPoint(spaceScaledPosition);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user