Merge branch 'development' of https://github.com/o3de/o3de into daimini/FocusMode/setup

This commit is contained in:
Danilo Aimini
2021-09-21 17:15:09 -07:00
6 changed files with 39 additions and 25 deletions
@@ -38,24 +38,24 @@ class TestAtomEditorComponentsMain(object):
7. Exposure Control
8. Directional Light
9. DepthOfField
10. Decal (Atom)
10. Decal
"""
cfg_args = [level]
expected_lines = [
# Decal (Atom) Component
"Decal (Atom) Entity successfully created",
"Decal (Atom)_test: Component added to the entity: True",
"Decal (Atom)_test: Component removed after UNDO: True",
"Decal (Atom)_test: Component added after REDO: True",
"Decal (Atom)_test: Entered game mode: True",
"Decal (Atom)_test: Exit game mode: True",
"Decal (Atom) Controller|Configuration|Material: SUCCESS",
"Decal (Atom)_test: Entity is hidden: True",
"Decal (Atom)_test: Entity is shown: True",
"Decal (Atom)_test: Entity deleted: True",
"Decal (Atom)_test: UNDO entity deletion works: True",
"Decal (Atom)_test: REDO entity deletion works: True",
# Decal Component
"Decal Entity successfully created",
"Decal_test: Component added to the entity: True",
"Decal_test: Component removed after UNDO: True",
"Decal_test: Component added after REDO: True",
"Decal_test: Entered game mode: True",
"Decal_test: Exit game mode: True",
"Decal Controller|Configuration|Material: SUCCESS",
"Decal_test: Entity is hidden: True",
"Decal_test: Entity is shown: True",
"Decal_test: Entity deleted: True",
"Decal_test: UNDO entity deletion works: True",
"Decal_test: REDO entity deletion works: True",
# DepthOfField Component
"DepthOfField Entity successfully created",
"DepthOfField_test: Component added to the entity: True",
@@ -184,7 +184,7 @@ def run():
material_asset = asset.AssetCatalogRequestBus(
bus.Broadcast, "GetAssetIdByPath", material_asset_path, math.Uuid(), False)
ComponentTests(
"Decal (Atom)", lambda entity_obj: verify_set_property(
"Decal", lambda entity_obj: verify_set_property(
entity_obj, "Controller|Configuration|Material", material_asset))
# Directional Light Component
@@ -73,7 +73,7 @@ def AtomEditorComponents_Decal_AddedToEntity():
# Test steps begin.
# 1. Create a Decal entity with no components.
decal_name = "Decal (Atom)"
decal_name = "Decal"
decal_entity = EditorEntity.create_editor_entity_at(math.Vector3(512.0, 512.0, 34.0), decal_name)
Report.critical_result(Tests.decal_creation, decal_entity.exists())
@@ -32,7 +32,7 @@ namespace AZ
if (AZ::EditContext* editContext = serializeContext->GetEditContext())
{
editContext->Class<EditorDecalComponent>(
"Decal (Atom)", "The Decal component allows an entity to project a texture or material onto a mesh")
"Decal", "The Decal component allows an entity to project a texture or material onto a mesh")
->ClassElement(AZ::Edit::ClassElements::EditorData, "")
->Attribute(AZ::Edit::Attributes::Category, "Atom")
->Attribute(AZ::Edit::Attributes::Icon, "Icons/Components/Decal.svg")
@@ -97,13 +97,25 @@ namespace AZ
BaseClass::Deactivate();
}
AZ::Transform EditorDecalComponent::GetTransform() const
AZ::Transform EditorDecalComponent::GetWorldTransform() const
{
AZ::Transform transform = AZ::Transform::CreateIdentity();
AZ::TransformBus::EventResult(transform, GetEntityId(), &AZ::TransformBus::Events::GetWorldTM);
return transform;
}
AZ::Matrix3x4 EditorDecalComponent::GetWorldTransformWithNonUniformScale() const
{
const AZ::Transform worldTransform = GetWorldTransform();
const AZ::Matrix3x3 rotationMat = AZ::Matrix3x3::CreateFromQuaternion(worldTransform.GetRotation());
const AZ::Vector3 nonUniformScale = m_controller.m_cachedNonUniformScale * worldTransform.GetUniformScale();
const AZ::Matrix3x3 nonUniformScaleMat = AZ::Matrix3x3::CreateScale(nonUniformScale);
const AZ::Matrix3x3 rotationAndScale = rotationMat * nonUniformScaleMat;
return AZ::Matrix3x4::CreateFromMatrix3x3AndTranslation(rotationAndScale, worldTransform.GetTranslation());
}
void EditorDecalComponent::DisplayEntityViewport(
[[maybe_unused]] const AzFramework::ViewportInfo& viewportInfo,
AzFramework::DebugDisplayRequests& debugDisplay)
@@ -113,11 +125,9 @@ namespace AZ
return;
}
AZ::Transform transform = GetTransform();
debugDisplay.SetColor(AZ::Colors::Red);
debugDisplay.PushMatrix(transform);
const AZ::Matrix3x4 transform = GetWorldTransformWithNonUniformScale();
debugDisplay.PushPremultipliedMatrix(transform);
debugDisplay.DrawWireBox(-AZ::Vector3::CreateOne(), AZ::Vector3::CreateOne());
AZ::Vector3 x1 = AZ::Vector3(-1, 0, 1);
@@ -136,7 +146,7 @@ namespace AZ
// Two diagonal edges
debugDisplay.DrawLine(p0, p2);
debugDisplay.DrawLine(p1, p3);
debugDisplay.PopMatrix();
debugDisplay.PopPremultipliedMatrix();
}
AZ::Aabb EditorDecalComponent::GetEditorSelectionBoundsViewport([[maybe_unused]] const AzFramework::ViewportInfo& viewportInfo)
@@ -56,7 +56,11 @@ namespace AZ
private:
AZ::Transform GetTransform() const;
// Returns the component transform which includes uniform-scale, rotation and translation
AZ::Transform GetWorldTransform() const;
// Returns the full transform, including both the uniform scale and non-uniform scale along with rotation and translation
AZ::Matrix3x4 GetWorldTransformWithNonUniformScale() const;
//! EditorRenderComponentAdapter overrides ...
u32 OnConfigurationChanged() override;
@@ -360,7 +360,7 @@
"CONFIGURATION": "profile",
"OUTPUT_DIRECTORY": "build\\windows_vs2019",
"CMAKE_OPTIONS": "-G \"Visual Studio 16 2019\" -DCMAKE_SYSTEM_VERSION=10.0 -DLY_UNITY_BUILD=TRUE -DLY_DISABLE_TEST_MODULES=TRUE -DLY_VERSION_ENGINE_NAME=o3de-sdk -DLY_INSTALLER_WIX_ROOT=\"!WIX! \"",
"EXTRA_CMAKE_OPTIONS": "-DLY_INSTALLER_AUTO_GEN_TAG=ON -DLY_INSTALLER_DOWNLOAD_URL=https://dkb1uj4hs9ikv.cloudfront.net -DLY_INSTALLER_LICENSE_URL=https://www.o3debinaries.org/license -DLY_INSTALLER_3RD_PARTY_LICENSE_URL=https://dkb1uj4hs9ikv.cloudfront.net/SPDX-Licenses.txt",
"EXTRA_CMAKE_OPTIONS": "-DLY_INSTALLER_AUTO_GEN_TAG=ON -DLY_INSTALLER_DOWNLOAD_URL=https://www.o3debinaries.org -DLY_INSTALLER_LICENSE_URL=https://www.o3debinaries.org/license",
"CPACK_BUCKET": "spectra-prism-staging-us-west-2",
"CMAKE_LY_PROJECTS": "",
"CMAKE_TARGET": "ALL_BUILD",